{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v1/responses":{"post":{"operationId":"_v1_responses","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.2-pro-2025-12-11","openai/gpt-5.2-pro-2025-12-11","openai/gpt-5-2-pro"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-5.2-pro-2025-12-11, openai/gpt-5.2-pro-2025-12-11, openai/gpt-5-2-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.4-2026-03-05","openai/gpt-5.4-2026-03-05","openai/gpt-5-4","openai/gpt-5-1","openai/gpt-5.1-2025-11-13","gpt-5.1-2025-11-13"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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.\nWe generally recommend altering this or temperature but not both."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-5.4-2026-03-05, openai/gpt-5.4-2026-03-05, openai/gpt-5-4, openai/gpt-5-1, openai/gpt-5.1-2025-11-13, gpt-5.1-2025-11-13"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.4-pro-2026-03-05","openai/gpt-5.4-pro-2026-03-05","openai/gpt-5-4-pro"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-5.4-pro-2026-03-05, openai/gpt-5.4-pro-2026-03-05, openai/gpt-5-4-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.5-2026-04-23","openai/gpt-5.5-2026-04-23","gpt-6-sol","openai/gpt-6-sol","gpt-6.1-terra","openai/gpt-6.1-terra","gpt-6-luna","openai/gpt-6-luna","openai/gpt-5-5","openai/gpt-5","gpt-5","openai/gpt-5-2025-08-07","gpt-5-2025-08-07","openai/gpt-5.6-luna","gpt-5.6-luna","openai/gpt-5.6-sol","gpt-5.6-sol","openai/gpt-5.6-terra","gpt-5.6-terra","openai/gpt-5-mini","gpt-5-mini","openai/gpt-5-mini-2025-08-07","gpt-5-mini-2025-08-07","openai/gpt-5-nano","gpt-5-nano","openai/gpt-5-nano-2025-08-07","gpt-5-nano-2025-08-07","openai/gpt-6.1-sol","gpt-6.1-sol","openai/gpt-6-astra","gpt-6-astra"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-5.5-2026-04-23, openai/gpt-5.5-2026-04-23, gpt-6-sol, openai/gpt-6-sol, gpt-6.1-terra, openai/gpt-6.1-terra, gpt-6-luna, openai/gpt-6-luna, openai/gpt-5-5, openai/gpt-5, gpt-5, openai/gpt-5-2025-08-07, gpt-5-2025-08-07, openai/gpt-5.6-luna, gpt-5.6-luna, openai/gpt-5.6-sol, gpt-5.6-sol, openai/gpt-5.6-terra, gpt-5.6-terra, openai/gpt-5-mini, gpt-5-mini, openai/gpt-5-mini-2025-08-07, gpt-5-mini-2025-08-07, openai/gpt-5-nano, gpt-5-nano, openai/gpt-5-nano-2025-08-07, gpt-5-nano-2025-08-07, openai/gpt-6.1-sol, gpt-6.1-sol, openai/gpt-6-astra, gpt-6-astra"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.5-pro-2026-04-23","openai/gpt-5.5-pro-2026-04-23","openai/gpt-5-5-pro"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-5.5-pro-2026-04-23, openai/gpt-5.5-pro-2026-04-23, openai/gpt-5-5-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5-1-codex","openai/gpt-5-1-codex-mini","openai/gpt-5-2-codex","openai/gpt-5-3-codex","openai/gpt-5.1-codex","gpt-5.1-codex","openai/gpt-5.1-codex-mini","gpt-5.1-codex-mini","openai/gpt-5.2-codex","gpt-5.2-codex","openai/gpt-5.3-codex","gpt-5.3-codex"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["local_shell"],"description":"The type of the local shell tool. Always local_shell."}},"required":["type"],"description":"A tool that allows the model to execute shell commands in a local environment."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"action":{"type":"object","properties":{"command":{"type":"array","items":{"type":"string"},"description":"The command to run."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables to set for the command."},"type":{"type":"string","enum":["exec"],"description":"The type of the local shell action. Always exec."},"timeout_ms":{"type":"integer","nullable":true,"description":"Optional timeout in milliseconds for the command."},"user":{"type":"string","nullable":true,"description":"Optional user to run the command as."},"working_directory":{"type":"string","nullable":true,"description":"Optional working directory to run the command in."}},"required":["command","env","type"],"description":"Execute a shell command on the server."},"call_id":{"type":"string","description":"The unique ID of the local shell tool call generated by the model."},"id":{"type":"string","description":"The unique ID of the local shell call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the local shell call."},"type":{"type":"string","enum":["local_shell_call"],"description":"The type of the local shell call. Always local_shell_call."}},"required":["action","call_id","id","status","type"],"description":"A tool call to run a command on the local shell."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the local shell tool call generated by the model."},"output":{"type":"string","description":"A JSON string of the output of the local shell tool call."},"type":{"type":"string","enum":["local_shell_call_output"],"description":"The type of the local shell tool call output. Always local_shell_call_output."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["id","output","type"],"description":"The output of a local shell tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["local_shell"],"description":"The type of the local shell tool. Always local_shell."}},"required":["type"],"description":"A tool that allows the model to execute shell commands in a local environment."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/gpt-5-1-codex, openai/gpt-5-1-codex-mini, openai/gpt-5-2-codex, openai/gpt-5-3-codex, openai/gpt-5.1-codex, gpt-5.1-codex, openai/gpt-5.1-codex-mini, gpt-5.1-codex-mini, openai/gpt-5.2-codex, gpt-5.2-codex, openai/gpt-5.3-codex, gpt-5.3-codex"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-4-3","grok-4-3","x-ai/grok-4-5","grok-4-5","x-ai/grok-4-6","grok-4-6","x-ai/grok-4-7","grok-4-7"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]},"filters":{"type":"object","properties":{"allowed_domains":{"type":"array","items":{"type":"string","minLength":1},"description":"Restrict results to these domains. Mutually exclusive with excluded_domains (enforced by xAI)."},"excluded_domains":{"type":"array","items":{"type":"string","minLength":1},"description":"Exclude results from these domains."}},"description":"Domain include/exclude filters for the web search."},"enable_image_understanding":{"type":"boolean","description":"Let Grok analyze images found on matching pages."},"enable_image_search":{"type":"boolean","description":"Include image search results."}},"required":["type"],"description":"xAI Agent Tools web_search. Documented here; validated by xAI (passthrough)."},{"type":"object","properties":{"type":{"type":"string","enum":["x_search"]},"allowed_x_handles":{"type":"array","items":{"type":"string","minLength":1},"description":"Restrict the search to posts from these X handles. Mutually exclusive with excluded_x_handles (enforced by xAI)."},"excluded_x_handles":{"type":"array","items":{"type":"string","minLength":1},"description":"Exclude posts from these X handles."},"from_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Earliest post date to consider, ISO8601 (YYYY-MM-DD)."},"to_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Latest post date to consider, ISO8601 (YYYY-MM-DD)."},"enable_image_understanding":{"type":"boolean","description":"Let Grok analyze images attached to matching posts."},"enable_video_understanding":{"type":"boolean","description":"Let Grok analyze videos attached to matching posts."}},"required":["type"],"description":"xAI Agent Tools x_search — real-time X (Twitter) search. Documented here; validated by xAI (passthrough)."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]},"filters":{"type":"object","properties":{"allowed_domains":{"type":"array","items":{"type":"string","minLength":1},"description":"Restrict results to these domains. Mutually exclusive with excluded_domains (enforced by xAI)."},"excluded_domains":{"type":"array","items":{"type":"string","minLength":1},"description":"Exclude results from these domains."}},"description":"Domain include/exclude filters for the web search."},"enable_image_understanding":{"type":"boolean","description":"Let Grok analyze images found on matching pages."},"enable_image_search":{"type":"boolean","description":"Include image search results."}},"required":["type"],"description":"xAI Agent Tools web_search. Documented here; validated by xAI (passthrough)."},{"type":"object","properties":{"type":{"type":"string","enum":["x_search"]},"allowed_x_handles":{"type":"array","items":{"type":"string","minLength":1},"description":"Restrict the search to posts from these X handles. Mutually exclusive with excluded_x_handles (enforced by xAI)."},"excluded_x_handles":{"type":"array","items":{"type":"string","minLength":1},"description":"Exclude posts from these X handles."},"from_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Earliest post date to consider, ISO8601 (YYYY-MM-DD)."},"to_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Latest post date to consider, ISO8601 (YYYY-MM-DD)."},"enable_image_understanding":{"type":"boolean","description":"Let Grok analyze images attached to matching posts."},"enable_video_understanding":{"type":"boolean","description":"Let Grok analyze videos attached to matching posts."}},"required":["type"],"description":"xAI Agent Tools x_search — real-time X (Twitter) search. Documented here; validated by xAI (passthrough)."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"max_turns":{"type":"integer","nullable":true,"minimum":1,"description":"Maximum number of agentic tool-calling turns (rounds of server-side tool calls) for this request. One turn can run several tools in parallel. When omitted, xAI applies its global default cap. Has no effect without a server-side tool."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"x-ai/grok-4-3, grok-4-3, x-ai/grok-4-5, grok-4-5, x-ai/grok-4-6, grok-4-6, x-ai/grok-4-7, grok-4-7"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-4.1","gpt-4.1","openai/gpt-4.1-2025-04-14","gpt-4.1-2025-04-14","openai/gpt-4.1-mini","gpt-4.1-mini","openai/gpt-4.1-mini-2025-04-14","gpt-4.1-mini-2025-04-14","openai/gpt-4o","gpt-4o","openai/gpt-4o-2024-08-06","gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","gpt-4o-2024-11-20","openai/gpt-4o-mini","gpt-4o-mini","openai/gpt-4o-mini-2024-07-18","gpt-4o-mini-2024-07-18"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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.\nWe generally recommend altering this or temperature but not both."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/gpt-4.1, gpt-4.1, openai/gpt-4.1-2025-04-14, gpt-4.1-2025-04-14, openai/gpt-4.1-mini, gpt-4.1-mini, openai/gpt-4.1-mini-2025-04-14, gpt-4.1-mini-2025-04-14, openai/gpt-4o, gpt-4o, openai/gpt-4o-2024-08-06, gpt-4o-2024-08-06, openai/gpt-4o-2024-11-20, gpt-4o-2024-11-20, openai/gpt-4o-mini, gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, gpt-4o-mini-2024-07-18"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5-2","openai/gpt-5.2-2025-12-11","gpt-5.2-2025-12-11"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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.\nWe generally recommend altering this or temperature but not both."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/gpt-5-2, openai/gpt-5.2-2025-12-11, gpt-5.2-2025-12-11"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5-pro","gpt-5-pro"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/gpt-5-pro, gpt-5-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/o3-2025-04-16","o3-2025-04-16"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/o3-2025-04-16, o3-2025-04-16"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/o3-pro","o3-pro"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"openai/o3-pro, o3-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-6.1-terra-pro","openai/gpt-6.1-terra-pro","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-7","anthropic/claude-opus-4-7","claude-opus-4-8","anthropic/claude-opus-4-8","claude-opus-5","anthropic/claude-opus-5","claude-fable-5-1","anthropic/claude-fable-5-1","claude-opus-5-5","anthropic/claude-opus-5-5","claude-sonnet-5-5","anthropic/claude-sonnet-5-5","claude-haiku-5-5","anthropic/claude-haiku-5-5","claude-fable-5-2","anthropic/claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","bytedance/seed-2-0-pro","bytedance/seed-2-0-code-preview","bytedance/dola-seed-2-0-pro","bytedance/dola-seed-2-0-code","deepseek-chat","deepseek/deepseek-chat","longcat-2.0","meituan/longcat-2.0","gemini-4-hydrogen","google/gemini-4-hydrogen","muse-ember","meta/muse-ember","mistral-large-2512","mistralai/mistral-large-2512","alibaba/glm-5.2","glm-5.2-fast-preview","alibaba/glm-5.2-fast-preview","qwen-max","alibaba/qwen-max","qwen-turbo","alibaba/qwen-turbo","qwen3.5-flash","alibaba/qwen3.5-flash","qwen3.5-plus","alibaba/qwen3.5-plus","qwen3-max-preview","alibaba/qwen3-max-preview","qwen3-max","alibaba/qwen3-max","qwen3-vl-plus","alibaba/qwen3-vl-plus","qwen3-vl-flash","alibaba/qwen3-vl-flash","qwen3-vl-32b-thinking","alibaba/qwen3-vl-32b-thinking","qwen3-vl-32b-instruct","alibaba/qwen3-vl-32b-instruct","qwen3.5-omni-plus","alibaba/qwen3.5-omni-plus","qwen3.5-omni-flash","alibaba/qwen3.5-omni-flash","qwen3.8-omni-flash","alibaba/qwen3.8-omni-flash","qwen3.6-max-preview","alibaba/qwen3.6-max-preview","qwen3.7-max","alibaba/qwen3.7-max","qwen3.8-max","alibaba/qwen3.8-max","qwen4-max","alibaba/qwen4-max","qwen3.8-flash","alibaba/qwen3.8-flash","qwen3.7-plus","alibaba/qwen3.7-plus","qwen3.6-plus","alibaba/qwen3.6-plus","qwen3.6-flash","alibaba/qwen3.6-flash","qwen3.6-27b","alibaba/qwen3.6-27b","qwen3.6-35b-a3b","alibaba/qwen3.6-35b-a3b","zhipu/glm-5-2-fast-preview","alibaba/qwen3.5-plus-20260218","minimax/m2","MiniMax-M2","minimax/m2-1","MiniMax-M2.1","minimax/m2-1-highspeed","MiniMax-M2.1-Highspeed","minimax/m2-5-20260218","MiniMax-M2.5","minimax/minimax-m3","MiniMax-M3","minimax/m2-7-20260402","MiniMax-M2.7","minimax/m2-7-highspeed","MiniMax-M2.7-Highspeed","minimax/m2-5-highspeed-20260218","MiniMax-M2.5-Highspeed","moonshot/kimi-k2-5","kimi-k2-5","moonshot/kimi-k2-6","moonshot/kimi-k2-7-code","kimi-k2-7-code","moonshot/kimi-k2-7-code-highspeed","kimi-k2-7-code-highspeed","moonshot/kimi-k3-1-pro","moonshot/kimi-k3.1-pro","moonshot/kimi-k3-1-pro-highspeed","moonshot/kimi-k3.1-pro-highspeed","ernie-5.0","baidu/ernie-5.0","baidu/ernie-5.5-flash-preview","ernie-5.5-flash-preview","x-ai/grok-3-beta","grok-3","x-ai/grok-3-mini-beta","grok-3-mini","grok-4-fast-reasoning","x-ai/grok-4-fast-reasoning","grok-4-fast-non-reasoning","x-ai/grok-4-fast-non-reasoning","grok-4-1-fast-reasoning","x-ai/grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","x-ai/grok-4-1-fast-non-reasoning","x-ai/grok-code-fast-1","grok-code-fast-1","xai/grok-build-0-1","x-ai/grok-build-0-1","grok-build-0-1","labs-leanstral-1-5","mistral/labs-leanstral-1-5","leanstral-1-5","mistral/leanstral-1-5","mercury-3","inception/mercury-3","ling-3.0-tiny","inclusionai/ling-3.0-tiny","ternary-bonsai-2-9b","prism-ml/ternary-bonsai-2-9b","crouton-alpha","stealth/crouton-alpha","inkling-2-small","thinkingmachines/inkling-2-small","aion-labs/aion-2.0","aion-2.0","aion-labs/aion-3.0","aion-3.0","aion-labs/aion-3.0-mini","aion-3.0-mini","aion-labs/aion-3.5","aion-3.5","aion-labs/aion-3.5-mini","aion-3.5-mini","alibaba/qwen3-235b-a22b-thinking-2507","qwen3-235b-a22b-thinking-2507","alibaba/qwen3-32b","qwen3-32b","alibaba/qwen3.8-2.4t-a95b","qwen3.8-2.4t-a95b","alibaba/qwen3.8-max-prime","qwen3.8-max-prime","alibaba/qwen3-coder-480b-a35b-instruct","qwen3-coder-480b-a35b-instruct","alibaba/qwen3-max-instruct","alibaba/qwen3-next-80b-a3b-instruct","qwen3-next-80b-a3b-instruct","alibaba/qwen-plus","qwen-plus","amazon/nova-2-lite-v1","nova-2-lite-v1","amazon/nova-lite-v1","nova-lite-v1","amazon/nova-micro-v1","nova-micro-v1","amazon/nova-premier-v1","nova-premier-v1","amazon/nova-pro-v1","nova-pro-v1","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-fable-latest","claude-fable-latest","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-haiku-latest","claude-haiku-latest","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-opus-4.6","claude-opus-4.6","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-opus-latest","claude-opus-latest","anthropic/claude-sonnet-4","claude-sonnet-4","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6","anthropic/claude-sonnet-5","claude-sonnet-5","anthropic/claude-sonnet-latest","claude-sonnet-latest","baidu/ernie-4.5-vl-424b-a47b","baidu/ernie-4-5-vl-424b-a47b","bytedance-seed/seed-1.6","seed-1.6","bytedance-seed/seed-1.6-flash","seed-1.6-flash","bytedance-seed/seed-2.0-lite","seed-2.0-lite","bytedance-seed/seed-2.0-mini","seed-2.0-mini","bytedance-seed/seed-2-1-turbo","seed-2-1-turbo","cohere/command-a","command-a","cohere/command-r-08-2024","command-r-08-2024","cohere/command-r7b-12-2024","command-r7b-12-2024","cohere/command-r-plus-08-2024","command-r-plus-08-2024","deepseek/deepseek-chat-v3-0324","deepseek/deepseek-chat-v3.1","deepseek/deepseek-non-reasoner-v3.1-terminus","deepseek-non-reasoner-v3.1-terminus","deepseek/deepseek-non-thinking-v3.2-exp","deepseek-non-thinking-v3.2-exp","deepseek/deepseek-reasoner-v3.1-terminus","deepseek-reasoner-v3.1-terminus","deepseek/deepseek-thinking-v3.2-exp","deepseek-thinking-v3.2-exp-v2","deepseek/deepseek-v4.1-flash","deepseek-flash","deepseek-v4.1-flash","deepseek/deepseek-flash","deepseek/deepseek-v4.1-flash-1017","deepseek/deepseek-v4-flash","deepseek-v4-flash","deepseek/deepseek-v4-flash-latest","deepseek-v4-flash-latest","deepseek/deepseek-v4-flash-vision-exp","deepseek-v4-flash-vision-exp","deepseek/deepseek-v4-pro","deepseek-v4-pro","deepseek/deepseek-v4-pro-0813","deepseek-v4-pro-0813","elorian/glimpse","glimpse","fireworks/ember-1","ember-1","google/gemini-2.5-flash","gemini-2.5-flash","google/gemini-2.5-flash-lite","gemini-2.5-flash-lite","google/gemini-2.5-flash-lite-preview","gemini-2.5-flash-lite-preview","google/gemini-2.5-pro","gemini-2.5-pro","google/gemini-2.5-pro-preview","gemini-2.5-pro-preview","google/gemini-3-1-flash-lite","google/gemini-3.1-flash-lite","gemini-3.1-flash-lite","google/gemini-3-1-flash-lite-preview","google/gemini-3.1-flash-lite-preview","gemini-3.1-flash-lite-preview","google/gemini-3.1-pro-preview","gemini-3-1-pro-preview","gemini-3.1-pro-preview","google/gemini-3-1-pro-preview","google/gemini-3.1-pro-preview-customtools","gemini-3.1-pro-preview-customtools","google/gemini-3-5-flash","gemini-3-5-flash","google/gemini-3.5-flash","gemini-3.5-flash","google/gemini-3-5-flash-lite","gemini-3-5-flash-lite","google/gemini-3.5-flash-lite","gemini-3.5-flash-lite","google/gemini-3-6-flash","gemini-3-6-flash","google/gemini-3.6-flash","gemini-3.6-flash","google/gemini-3-7-flash","gemini-3-7-flash","google/gemini-3.7-flash","gemini-3.7-flash","google/gemini-3-8-flash","gemini-3-8-flash","google/gemini-3.8-flash","gemini-3.8-flash","google/gemini-3-flash-preview","gemini-3-flash-preview","google/gemini-3-pro-image","gemini-3-pro-image","google/gemini-3-pro-image-preview","google/gemini-4-argon","gemini-4-argon","google/gemini-4-carbon","gemini-4-carbon","google/gemini-flash-latest","gemini-flash-latest","google/gemini-pro-latest","gemini-pro-latest","google/gemma-4-26b-a4b-it","gemma-4-26b-a4b-it","google/gemma-4-26b-a4b-it-maas","gemma-4-26b-a4b-it-maas","ibm-granite/granite-4.2-8b","granite-4.2-8b","inception/mercury-2","mercury-2","inception/mercury-2.5","mercury-2.5","inclusionai/ling-3.0-flash","inclusionai/ling-3.0-flash:free","ling-3.0-flash","ling-3.0-flash:free","inclusionai/ling-3.0-flash-vl","inclusionai/ling-3.0-flash-vl:free","ling-3.0-flash-vl","ling-3.0-flash-vl:free","inclusionai/ling-3.1-flash","ling-3.1-flash","liquid/lfm-2.5-24b-a2b","lfm-2.5-24b-a2b","meta-llama/Llama-3.3-70B-Instruct-Turbo","meta/muse-glimmer-30b","muse-glimmer-30b","meta/muse-spark-1.1","muse-spark-1.1","meta/muse-spark-1.2","muse-spark-1.2","meta/muse-spark-1.3","muse-spark-1.3","meta/muse-spark-open","muse-spark-open","meta/muse-wonder","muse-wonder","minimax/m1","minimax-m1","minimax/minimax-m3.1-flash","minimax-m3.1-flash","minimax/MiniMax-Text-01","minimax-text-01","mistralai/codestral-2508","codestral-2508","mistralai/devstral-2512","devstral-2512","mistralai/ministral-14b-2512","ministral-14b-2512","mistralai/ministral-3b-2512","ministral-3b-2512","mistralai/ministral-8b-2512","ministral-8b-2512","mistralai/mistral-large","mistral-large","mistralai/mistral-large-2407","mistral-large-2407","mistralai/mistral-large-4-0","mistral-large-4-0","mistral/mistral-large-4-0","mistralai/mistral-medium-3","mistral-medium-3","mistralai/mistral-medium-3.1","mistral-medium-3.1","mistralai/mistral-medium-3-5","mistral-medium-3-5","mistralai/mistral-nemo","mistral-nemo","mistralai/mistral-saba","mistral-saba","mistralai/mistral-small-2603","mistral-small-2603","mistralai/mistral-small-3.1-24b-instruct","mistral-small-3.1-24b-instruct","mistralai/mistral-small-3.2-24b-instruct","mistral-small-3.2-24b-instruct","mistralai/mixtral-8x22b-instruct","mixtral-8x22b-instruct","mistralai/voxtral-small-24b-2507","voxtral-small-24b-2507","moonshotai/kimi-k2","kimi-k2","moonshotai/kimi-k2-0905","kimi-k2-0905","moonshotai/kimi-k2.5","kimi-k2.5","moonshotai/kimi-k2.6","kimi-k2.6","moonshotai/kimi-k2.7-code","kimi-k2.7-code","moonshotai/kimi-k2-thinking","kimi-k2-thinking","moonshotai/kimi-latest","kimi-latest","moonshot/kimi-k3","kimi-k3","moonshotai/kimi-k3","nousresearch/hermes-3-llama-3.1-405b","hermes-3-llama-3.1-405b","nousresearch/hermes-3-llama-3.1-70b","hermes-3-llama-3.1-70b","nvidia/nemotron-3.5-lightning","nemotron-3.5-lightning","nemotron-3.5-lightning:free","nvidia/nemotron-3.5-lightning:free","nvidia/nemotron-3.5-super-vl","nemotron-3.5-super-vl","nvidia/nemotron-3-nano-30b-a3b","nemotron-3-nano-30b-a3b","nvidia/nemotron-3-super-120b-a12b","nemotron-3-super-120b-a12b","nvidia/nemotron-3-ultra-550b-a55b","nemotron-3-ultra-550b-a55b","openai/gpt-3.5-turbo-0613","gpt-3.5-turbo-0613","openai/gpt-4o-2024-05-13","gpt-4o-2024-05-13","openai/gpt-5.1","gpt-5.1","openai/gpt-5.1-codex-max","gpt-5.1-codex-max","openai/gpt-5.2","gpt-5.2","openai/gpt-5.2-chat","gpt-5.2-chat","openai/gpt-5.2-pro","gpt-5.2-pro","openai/gpt-5.4","gpt-5.4","openai/gpt-5.4-mini","gpt-5.4-mini","openai/gpt-5.4-nano","gpt-5.4-nano","openai/gpt-5.4-pro","gpt-5.4-pro","openai/gpt-5.5","gpt-5.5","openai/gpt-5.5-pro","gpt-5.5-pro","openai/gpt-5.6-luna-pro","gpt-5.6-luna-pro","openai/gpt-5.6-sol-pro","gpt-5.6-sol-pro","openai/gpt-5.6-terra-pro","gpt-5.6-terra-pro","openai/gpt-chat-latest","gpt-chat-latest","openai/gpt-latest","gpt-latest","openai/gpt-mini-latest","gpt-mini-latest","openai/gpt-oss-120b","gpt-oss-120b","openai/gpt-oss-20b","gpt-oss-20b","openai/gpt-oss-safeguard-20b","gpt-oss-safeguard-20b","openai/o3","o3","perceptron/perceptron-mk1.5","perceptron-mk1.5","poolside/laguna-s-2.1","laguna-s-2.1","poolside/laguna-xs-2.1","laguna-xs-2.1","prism-ml/ternary-bonsai-2-27b","ternary-bonsai-2-27b","reflection/beam-1.0-501b-a23b","beam-1.0-501b-a23b","rekaai/reka-edge","reka-edge","relace/relace-search","relace-search","sakana/fugu-max","fugu-max","sakana/fugu-ultra","fugu-ultra","sakana/fugu-ultra-v2","fugu-ultra-v2","sakana/sakana-namazu","sakana-namazu","stealth/space-bunny-alpha","space-bunny-alpha","stepfun/step-3.7-flash","step-3.7-flash","stepfun/step-5-preview","step-5-preview","tencent/hy3","hy3","tencent/hy4","hy4","tencent/hy4-preview","hy4-preview","thinkingmachines/inkling","inkling","unbiased/pareto","pareto","unbiased/pareto-26.10","pareto-26.10","unbiased/pareto-26.10-preview","pareto-26.10-preview","upstage/solar-mini4","solar-mini4","upstage/solar-pro4","solar-pro4","x-ai/grok-4-20-0309-non-reasoning","grok-4-20-0309-non-reasoning","x-ai/grok-4-20-0309-reasoning","grok-4-20-0309-reasoning","xiaomi/mimo-v2.5","mimo-v2.5","xiaomi/mimo-v2.5-pro","mimo-v2.5-pro","xiaomi/mimo-v2.6-flash","mimo-v2.6-flash","xiaomi/mimo-v2.6-pro","mimo-v2.6-pro","xiaomi/mimo-v2.6-pro-ultraspeed","mimo-v2.6-pro-ultraspeed","z-ai/glm-4.5","z-ai/glm-4.5-air","z-ai/glm-4.5v","glm-4.5v","z-ai/glm-4.6","z-ai/glm-4.6v","glm-4.6v","z-ai/glm-4.7","z-ai/glm-4.7-flash","glm-4.7-flash","z-ai/glm-5","z-ai/glm-5.1","z-ai/glm-5.2","z-ai/glm-5.3","z-ai/glm-5.3-flash","glm-5.3-flash","ox-alpha","stealth/ox-alpha","zhipu/glm-5.3-flash","z-ai/glm-5.3-flashx","glm-5.3-flashx","zhipu/glm-5.3-flashx","z-ai/glm-5-turbo","glm-5-turbo","z-ai/glm-5v-turbo","glm-5v-turbo","zhipu/glm-4.5","glm-4.5","zhipu/glm-4.5-air","glm-4.5-air","zhipu/glm-4.6","glm-4.6","zhipu/glm-4.7","glm-4.7","zhipu/glm-5","glm-5","zhipu/glm-5-1","zhipu/glm-5.1","glm-5.1","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2","zhipu/glm-5-3","zhipu/glm-5.3","glm-5.3"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"gpt-6.1-terra-pro, openai/gpt-6.1-terra-pro, 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-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-opus-5, anthropic/claude-opus-5, claude-fable-5-1, anthropic/claude-fable-5-1, claude-opus-5-5, anthropic/claude-opus-5-5, claude-sonnet-5-5, anthropic/claude-sonnet-5-5, claude-haiku-5-5, anthropic/claude-haiku-5-5, claude-fable-5-2, anthropic/claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, bytedance/seed-2-0-pro, bytedance/seed-2-0-code-preview, bytedance/dola-seed-2-0-pro, bytedance/dola-seed-2-0-code, deepseek-chat, deepseek/deepseek-chat, longcat-2.0, meituan/longcat-2.0, gemini-4-hydrogen, google/gemini-4-hydrogen, muse-ember, meta/muse-ember, mistral-large-2512, mistralai/mistral-large-2512, alibaba/glm-5.2, glm-5.2-fast-preview, alibaba/glm-5.2-fast-preview, qwen-max, alibaba/qwen-max, qwen-turbo, alibaba/qwen-turbo, qwen3.5-flash, alibaba/qwen3.5-flash, qwen3.5-plus, alibaba/qwen3.5-plus, qwen3-max-preview, alibaba/qwen3-max-preview, qwen3-max, alibaba/qwen3-max, qwen3-vl-plus, alibaba/qwen3-vl-plus, qwen3-vl-flash, alibaba/qwen3-vl-flash, qwen3-vl-32b-thinking, alibaba/qwen3-vl-32b-thinking, qwen3-vl-32b-instruct, alibaba/qwen3-vl-32b-instruct, qwen3.5-omni-plus, alibaba/qwen3.5-omni-plus, qwen3.5-omni-flash, alibaba/qwen3.5-omni-flash, qwen3.8-omni-flash, alibaba/qwen3.8-omni-flash, qwen3.6-max-preview, alibaba/qwen3.6-max-preview, qwen3.7-max, alibaba/qwen3.7-max, qwen3.8-max, alibaba/qwen3.8-max, qwen4-max, alibaba/qwen4-max, qwen3.8-flash, alibaba/qwen3.8-flash, qwen3.7-plus, alibaba/qwen3.7-plus, qwen3.6-plus, alibaba/qwen3.6-plus, qwen3.6-flash, alibaba/qwen3.6-flash, qwen3.6-27b, alibaba/qwen3.6-27b, qwen3.6-35b-a3b, alibaba/qwen3.6-35b-a3b, zhipu/glm-5-2-fast-preview, alibaba/qwen3.5-plus-20260218, minimax/m2, MiniMax-M2, minimax/m2-1, MiniMax-M2.1, minimax/m2-1-highspeed, MiniMax-M2.1-Highspeed, minimax/m2-5-20260218, MiniMax-M2.5, minimax/minimax-m3, MiniMax-M3, minimax/m2-7-20260402, MiniMax-M2.7, minimax/m2-7-highspeed, MiniMax-M2.7-Highspeed, minimax/m2-5-highspeed-20260218, MiniMax-M2.5-Highspeed, moonshot/kimi-k2-5, kimi-k2-5, moonshot/kimi-k2-6, moonshot/kimi-k2-7-code, kimi-k2-7-code, moonshot/kimi-k2-7-code-highspeed, kimi-k2-7-code-highspeed, moonshot/kimi-k3-1-pro, moonshot/kimi-k3.1-pro, moonshot/kimi-k3-1-pro-highspeed, moonshot/kimi-k3.1-pro-highspeed, ernie-5.0, baidu/ernie-5.0, baidu/ernie-5.5-flash-preview, ernie-5.5-flash-preview, x-ai/grok-3-beta, grok-3, x-ai/grok-3-mini-beta, grok-3-mini, grok-4-fast-reasoning, x-ai/grok-4-fast-reasoning, grok-4-fast-non-reasoning, x-ai/grok-4-fast-non-reasoning, grok-4-1-fast-reasoning, x-ai/grok-4-1-fast-reasoning, grok-4-1-fast-non-reasoning, x-ai/grok-4-1-fast-non-reasoning, x-ai/grok-code-fast-1, grok-code-fast-1, xai/grok-build-0-1, x-ai/grok-build-0-1, grok-build-0-1, labs-leanstral-1-5, mistral/labs-leanstral-1-5, leanstral-1-5, mistral/leanstral-1-5, mercury-3, inception/mercury-3, ling-3.0-tiny, inclusionai/ling-3.0-tiny, ternary-bonsai-2-9b, prism-ml/ternary-bonsai-2-9b, crouton-alpha, stealth/crouton-alpha, inkling-2-small, thinkingmachines/inkling-2-small, aion-labs/aion-2.0, aion-2.0, aion-labs/aion-3.0, aion-3.0, aion-labs/aion-3.0-mini, aion-3.0-mini, aion-labs/aion-3.5, aion-3.5, aion-labs/aion-3.5-mini, aion-3.5-mini, alibaba/qwen3-235b-a22b-thinking-2507, qwen3-235b-a22b-thinking-2507, alibaba/qwen3-32b, qwen3-32b, alibaba/qwen3.8-2.4t-a95b, qwen3.8-2.4t-a95b, alibaba/qwen3.8-max-prime, qwen3.8-max-prime, alibaba/qwen3-coder-480b-a35b-instruct, qwen3-coder-480b-a35b-instruct, alibaba/qwen3-max-instruct, alibaba/qwen3-next-80b-a3b-instruct, qwen3-next-80b-a3b-instruct, alibaba/qwen-plus, qwen-plus, amazon/nova-2-lite-v1, nova-2-lite-v1, amazon/nova-lite-v1, nova-lite-v1, amazon/nova-micro-v1, nova-micro-v1, amazon/nova-premier-v1, nova-premier-v1, amazon/nova-pro-v1, nova-pro-v1, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-fable-latest, claude-fable-latest, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-haiku-latest, claude-haiku-latest, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-opus-4.6, claude-opus-4.6, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-opus-latest, claude-opus-latest, anthropic/claude-sonnet-4, claude-sonnet-4, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6, anthropic/claude-sonnet-5, claude-sonnet-5, anthropic/claude-sonnet-latest, claude-sonnet-latest, baidu/ernie-4.5-vl-424b-a47b, baidu/ernie-4-5-vl-424b-a47b, bytedance-seed/seed-1.6, seed-1.6, bytedance-seed/seed-1.6-flash, seed-1.6-flash, bytedance-seed/seed-2.0-lite, seed-2.0-lite, bytedance-seed/seed-2.0-mini, seed-2.0-mini, bytedance-seed/seed-2-1-turbo, seed-2-1-turbo, cohere/command-a, command-a, cohere/command-r-08-2024, command-r-08-2024, cohere/command-r7b-12-2024, command-r7b-12-2024, cohere/command-r-plus-08-2024, command-r-plus-08-2024, deepseek/deepseek-chat-v3-0324, deepseek/deepseek-chat-v3.1, deepseek/deepseek-non-reasoner-v3.1-terminus, deepseek-non-reasoner-v3.1-terminus, deepseek/deepseek-non-thinking-v3.2-exp, deepseek-non-thinking-v3.2-exp, deepseek/deepseek-reasoner-v3.1-terminus, deepseek-reasoner-v3.1-terminus, deepseek/deepseek-thinking-v3.2-exp, deepseek-thinking-v3.2-exp-v2, deepseek/deepseek-v4.1-flash, deepseek-flash, deepseek-v4.1-flash, deepseek/deepseek-flash, deepseek/deepseek-v4.1-flash-1017, deepseek/deepseek-v4-flash, deepseek-v4-flash, deepseek/deepseek-v4-flash-latest, deepseek-v4-flash-latest, deepseek/deepseek-v4-flash-vision-exp, deepseek-v4-flash-vision-exp, deepseek/deepseek-v4-pro, deepseek-v4-pro, deepseek/deepseek-v4-pro-0813, deepseek-v4-pro-0813, elorian/glimpse, glimpse, fireworks/ember-1, ember-1, google/gemini-2.5-flash, gemini-2.5-flash, google/gemini-2.5-flash-lite, gemini-2.5-flash-lite, google/gemini-2.5-flash-lite-preview, gemini-2.5-flash-lite-preview, google/gemini-2.5-pro, gemini-2.5-pro, google/gemini-2.5-pro-preview, gemini-2.5-pro-preview, google/gemini-3-1-flash-lite, google/gemini-3.1-flash-lite, gemini-3.1-flash-lite, google/gemini-3-1-flash-lite-preview, google/gemini-3.1-flash-lite-preview, gemini-3.1-flash-lite-preview, google/gemini-3.1-pro-preview, gemini-3-1-pro-preview, gemini-3.1-pro-preview, google/gemini-3-1-pro-preview, google/gemini-3.1-pro-preview-customtools, gemini-3.1-pro-preview-customtools, google/gemini-3-5-flash, gemini-3-5-flash, google/gemini-3.5-flash, gemini-3.5-flash, google/gemini-3-5-flash-lite, gemini-3-5-flash-lite, google/gemini-3.5-flash-lite, gemini-3.5-flash-lite, google/gemini-3-6-flash, gemini-3-6-flash, google/gemini-3.6-flash, gemini-3.6-flash, google/gemini-3-7-flash, gemini-3-7-flash, google/gemini-3.7-flash, gemini-3.7-flash, google/gemini-3-8-flash, gemini-3-8-flash, google/gemini-3.8-flash, gemini-3.8-flash, google/gemini-3-flash-preview, gemini-3-flash-preview, google/gemini-3-pro-image, gemini-3-pro-image, google/gemini-3-pro-image-preview, google/gemini-4-argon, gemini-4-argon, google/gemini-4-carbon, gemini-4-carbon, google/gemini-flash-latest, gemini-flash-latest, google/gemini-pro-latest, gemini-pro-latest, google/gemma-4-26b-a4b-it, gemma-4-26b-a4b-it, google/gemma-4-26b-a4b-it-maas, gemma-4-26b-a4b-it-maas, ibm-granite/granite-4.2-8b, granite-4.2-8b, inception/mercury-2, mercury-2, inception/mercury-2.5, mercury-2.5, inclusionai/ling-3.0-flash, inclusionai/ling-3.0-flash:free, ling-3.0-flash, ling-3.0-flash:free, inclusionai/ling-3.0-flash-vl, inclusionai/ling-3.0-flash-vl:free, ling-3.0-flash-vl, ling-3.0-flash-vl:free, inclusionai/ling-3.1-flash, ling-3.1-flash, liquid/lfm-2.5-24b-a2b, lfm-2.5-24b-a2b, meta-llama/Llama-3.3-70B-Instruct-Turbo, meta/muse-glimmer-30b, muse-glimmer-30b, meta/muse-spark-1.1, muse-spark-1.1, meta/muse-spark-1.2, muse-spark-1.2, meta/muse-spark-1.3, muse-spark-1.3, meta/muse-spark-open, muse-spark-open, meta/muse-wonder, muse-wonder, minimax/m1, minimax-m1, minimax/minimax-m3.1-flash, minimax-m3.1-flash, minimax/MiniMax-Text-01, minimax-text-01, mistralai/codestral-2508, codestral-2508, mistralai/devstral-2512, devstral-2512, mistralai/ministral-14b-2512, ministral-14b-2512, mistralai/ministral-3b-2512, ministral-3b-2512, mistralai/ministral-8b-2512, ministral-8b-2512, mistralai/mistral-large, mistral-large, mistralai/mistral-large-2407, mistral-large-2407, mistralai/mistral-large-4-0, mistral-large-4-0, mistral/mistral-large-4-0, mistralai/mistral-medium-3, mistral-medium-3, mistralai/mistral-medium-3.1, mistral-medium-3.1, mistralai/mistral-medium-3-5, mistral-medium-3-5, mistralai/mistral-nemo, mistral-nemo, mistralai/mistral-saba, mistral-saba, mistralai/mistral-small-2603, mistral-small-2603, mistralai/mistral-small-3.1-24b-instruct, mistral-small-3.1-24b-instruct, mistralai/mistral-small-3.2-24b-instruct, mistral-small-3.2-24b-instruct, mistralai/mixtral-8x22b-instruct, mixtral-8x22b-instruct, mistralai/voxtral-small-24b-2507, voxtral-small-24b-2507, moonshotai/kimi-k2, kimi-k2, moonshotai/kimi-k2-0905, kimi-k2-0905, moonshotai/kimi-k2.5, kimi-k2.5, moonshotai/kimi-k2.6, kimi-k2.6, moonshotai/kimi-k2.7-code, kimi-k2.7-code, moonshotai/kimi-k2-thinking, kimi-k2-thinking, moonshotai/kimi-latest, kimi-latest, moonshot/kimi-k3, kimi-k3, moonshotai/kimi-k3, nousresearch/hermes-3-llama-3.1-405b, hermes-3-llama-3.1-405b, nousresearch/hermes-3-llama-3.1-70b, hermes-3-llama-3.1-70b, nvidia/nemotron-3.5-lightning, nemotron-3.5-lightning, nemotron-3.5-lightning:free, nvidia/nemotron-3.5-lightning:free, nvidia/nemotron-3.5-super-vl, nemotron-3.5-super-vl, nvidia/nemotron-3-nano-30b-a3b, nemotron-3-nano-30b-a3b, nvidia/nemotron-3-super-120b-a12b, nemotron-3-super-120b-a12b, nvidia/nemotron-3-ultra-550b-a55b, nemotron-3-ultra-550b-a55b, openai/gpt-3.5-turbo-0613, gpt-3.5-turbo-0613, openai/gpt-4o-2024-05-13, gpt-4o-2024-05-13, openai/gpt-5.1, gpt-5.1, openai/gpt-5.1-codex-max, gpt-5.1-codex-max, openai/gpt-5.2, gpt-5.2, openai/gpt-5.2-chat, gpt-5.2-chat, openai/gpt-5.2-pro, gpt-5.2-pro, openai/gpt-5.4, gpt-5.4, openai/gpt-5.4-mini, gpt-5.4-mini, openai/gpt-5.4-nano, gpt-5.4-nano, openai/gpt-5.4-pro, gpt-5.4-pro, openai/gpt-5.5, gpt-5.5, openai/gpt-5.5-pro, gpt-5.5-pro, openai/gpt-5.6-luna-pro, gpt-5.6-luna-pro, openai/gpt-5.6-sol-pro, gpt-5.6-sol-pro, openai/gpt-5.6-terra-pro, gpt-5.6-terra-pro, openai/gpt-chat-latest, gpt-chat-latest, openai/gpt-latest, gpt-latest, openai/gpt-mini-latest, gpt-mini-latest, openai/gpt-oss-120b, gpt-oss-120b, openai/gpt-oss-20b, gpt-oss-20b, openai/gpt-oss-safeguard-20b, gpt-oss-safeguard-20b, openai/o3, o3, perceptron/perceptron-mk1.5, perceptron-mk1.5, poolside/laguna-s-2.1, laguna-s-2.1, poolside/laguna-xs-2.1, laguna-xs-2.1, prism-ml/ternary-bonsai-2-27b, ternary-bonsai-2-27b, reflection/beam-1.0-501b-a23b, beam-1.0-501b-a23b, rekaai/reka-edge, reka-edge, relace/relace-search, relace-search, sakana/fugu-max, fugu-max, sakana/fugu-ultra, fugu-ultra, sakana/fugu-ultra-v2, fugu-ultra-v2, sakana/sakana-namazu, sakana-namazu, stealth/space-bunny-alpha, space-bunny-alpha, stepfun/step-3.7-flash, step-3.7-flash, stepfun/step-5-preview, step-5-preview, tencent/hy3, hy3, tencent/hy4, hy4, tencent/hy4-preview, hy4-preview, thinkingmachines/inkling, inkling, unbiased/pareto, pareto, unbiased/pareto-26.10, pareto-26.10, unbiased/pareto-26.10-preview, pareto-26.10-preview, upstage/solar-mini4, solar-mini4, upstage/solar-pro4, solar-pro4, x-ai/grok-4-20-0309-non-reasoning, grok-4-20-0309-non-reasoning, x-ai/grok-4-20-0309-reasoning, grok-4-20-0309-reasoning, xiaomi/mimo-v2.5, mimo-v2.5, xiaomi/mimo-v2.5-pro, mimo-v2.5-pro, xiaomi/mimo-v2.6-flash, mimo-v2.6-flash, xiaomi/mimo-v2.6-pro, mimo-v2.6-pro, xiaomi/mimo-v2.6-pro-ultraspeed, mimo-v2.6-pro-ultraspeed, z-ai/glm-4.5, z-ai/glm-4.5-air, z-ai/glm-4.5v, glm-4.5v, z-ai/glm-4.6, z-ai/glm-4.6v, glm-4.6v, z-ai/glm-4.7, z-ai/glm-4.7-flash, glm-4.7-flash, z-ai/glm-5, z-ai/glm-5.1, z-ai/glm-5.2, z-ai/glm-5.3, z-ai/glm-5.3-flash, glm-5.3-flash, ox-alpha, stealth/ox-alpha, zhipu/glm-5.3-flash, z-ai/glm-5.3-flashx, glm-5.3-flashx, zhipu/glm-5.3-flashx, z-ai/glm-5-turbo, glm-5-turbo, z-ai/glm-5v-turbo, glm-5v-turbo, zhipu/glm-4.5, glm-4.5, zhipu/glm-4.5-air, glm-4.5-air, zhipu/glm-4.6, glm-4.6, zhipu/glm-4.7, glm-4.7, zhipu/glm-5, glm-5, zhipu/glm-5-1, zhipu/glm-5.1, glm-5.1, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2, zhipu/glm-5-3, zhipu/glm-5.3, glm-5.3"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"],"description":"The results of a web search tool call."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"code":{"type":"string","description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","interpreting"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["code","id","outputs","status","type","container_id"],"description":"A tool call to run code."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The JSON schema describing the tool's input."},"name":{"type":"string","description":"The name of the tool."},"annotations":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Additional annotations about the tool."},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["input_schema","name"]},"description":"The tools available on the server."},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"],"description":"A list of tools available on an MCP server."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"],"description":"A request for human approval of a tool invocation."},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"],"description":"A response to an MCP approval request."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"],"description":"An invocation of a tool on an MCP server."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Constrains the verbosity of the model response. Lower values give more concise answers."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search","web_search_2025_08_26"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"filters":{"type":"object","nullable":true,"properties":{"allowed_domains":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Domains the search is limited to, e.g. `openai.com`."}},"description":"Filters applied to the search."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"input":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the user role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role."},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"Whether the assistant message was intermediate commentary or the final answer of its turn."},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}]}}],"description":"The content of the output message."}},"required":["role","content"],"description":"An output message from the model."},{"type":"object","properties":{"type":{"type":"string","enum":["additional_tools"],"description":"The type of the input item. Always `additional_tools`."},"role":{"type":"string","enum":["developer"],"description":"The role of the item. Always `developer`."},"id":{"type":"string","nullable":true,"description":"Client-side id of the item."},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"Tool definitions, same schema as the top-level `tools` array. They are merged into `tools` before the request is dispatched."}},"required":["type","tools"],"description":"Extra tool definitions sent as an input item (Codex CLI). Merged into the top-level `tools` array before dispatch."},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"],"description":"A tool call to run a function."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"],"description":"The output of a function tool call."},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"],"description":"A call to a custom tool."},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"],"description":"The output of a custom tool call."},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["summary","type"],"description":"A description of the chain of thought used by a reasoning model while generating a response."},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]}}],"description":"Text, image, or file inputs to the model, used to generate a response."},"background":{"type":"boolean","default":false,"description":"Whether to run the model response in the background."},"instructions":{"type":"string","nullable":true,"description":"A system (or developer) message inserted into the model's context.\n\nWhen using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses."},"include":{"type":"array","nullable":true,"items":{"type":"string","enum":["message.input_image.image_url","computer_call_output.output.image_url","reasoning.encrypted_content","code_interpreter_call.outputs"]},"description":"Specify additional output data to include in the model response. Currently supported values are:\n- code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.\n- computer_call_output.output.image_url: Include image urls from the computer call output.\n- file_search_call.results: Include the search results of the file search tool call.\n- message.output_text.logprobs: Include logprobs with assistant messages.\n- reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).\n"},"max_output_tokens":{"type":"integer","minimum":16,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations."},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}]},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables."},"store":{"type":"boolean","nullable":true,"default":false,"description":"Whether to store the generated model response for later retrieval via API."},"stream":{"type":"boolean","nullable":true,"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. "},"text":{"type":"object","properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"default":{"type":"text"},"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"truncation":{"type":"string","enum":["auto","disabled"],"default":"disabled","description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"anyOf":[{"type":"boolean"},{"nullable":true},{"nullable":true}],"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","parameters","type"],"description":"Defines a function in your own code the model can choose to call."},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"]}],"description":"How the model should select which tool (or tools) to use when generating a response."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to allow the model to run tool calls in parallel."},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"o-series models only\nConfiguration options for reasoning models."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","input"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"object","nullable":true,"properties":{"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}},"text/event-stream":{"schema":{"type":"object","properties":{"meta":{"type":"object","nullable":true,"properties":{"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}}}}}}},"/v1/responses/:response_id":{"get":{"operationId":"_v1_responses_:response_id","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.2-pro-2025-12-11","openai/gpt-5.2-pro-2025-12-11","gpt-5.4-2026-03-05","openai/gpt-5.4-2026-03-05","gpt-5.4-pro-2026-03-05","openai/gpt-5.4-pro-2026-03-05","gpt-5.5-2026-04-23","openai/gpt-5.5-2026-04-23","gpt-5.5-pro-2026-04-23","openai/gpt-5.5-pro-2026-04-23","gpt-6-sol","openai/gpt-6-sol","gpt-6.1-terra","openai/gpt-6.1-terra","gpt-6-luna","openai/gpt-6-luna","openai/gpt-5-1-codex","openai/gpt-5-1-codex-mini","openai/gpt-5-2-pro","openai/gpt-5-2-codex","openai/gpt-5-3-codex","openai/gpt-5-4","openai/gpt-5-4-pro","openai/gpt-5-5","openai/gpt-5-5-pro","openai/gpt-4.1","gpt-4.1","openai/gpt-4.1-2025-04-14","gpt-4.1-2025-04-14","openai/gpt-4.1-mini","gpt-4.1-mini","openai/gpt-4.1-mini-2025-04-14","gpt-4.1-mini-2025-04-14","openai/gpt-4o","gpt-4o","openai/gpt-4o-2024-08-06","gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","gpt-4o-2024-11-20","openai/gpt-4o-mini","gpt-4o-mini","openai/gpt-4o-mini-2024-07-18","gpt-4o-mini-2024-07-18","openai/gpt-5","gpt-5","openai/gpt-5-1","openai/gpt-5.1-2025-11-13","gpt-5.1-2025-11-13","openai/gpt-5.1-codex","gpt-5.1-codex","openai/gpt-5.1-codex-mini","gpt-5.1-codex-mini","openai/gpt-5-2","openai/gpt-5-2025-08-07","gpt-5-2025-08-07","openai/gpt-5.2-2025-12-11","gpt-5.2-2025-12-11","openai/gpt-5.2-codex","gpt-5.2-codex","openai/gpt-5.3-codex","gpt-5.3-codex","openai/gpt-5.6-luna","gpt-5.6-luna","openai/gpt-5.6-sol","gpt-5.6-sol","openai/gpt-5.6-terra","gpt-5.6-terra","openai/gpt-5-mini","gpt-5-mini","openai/gpt-5-mini-2025-08-07","gpt-5-mini-2025-08-07","openai/gpt-5-nano","gpt-5-nano","openai/gpt-5-nano-2025-08-07","gpt-5-nano-2025-08-07","openai/gpt-5-pro","gpt-5-pro","openai/gpt-6.1-sol","gpt-6.1-sol","openai/gpt-6-astra","gpt-6-astra","openai/o3-2025-04-16","o3-2025-04-16","openai/o3-pro","o3-pro"]},"id":{"type":"string"}},"required":["model","id"],"title":"gpt-5.2-pro-2025-12-11, openai/gpt-5.2-pro-2025-12-11, gpt-5.4-2026-03-05, openai/gpt-5.4-2026-03-05, gpt-5.4-pro-2026-03-05, openai/gpt-5.4-pro-2026-03-05, gpt-5.5-2026-04-23, openai/gpt-5.5-2026-04-23, gpt-5.5-pro-2026-04-23, openai/gpt-5.5-pro-2026-04-23, gpt-6-sol, openai/gpt-6-sol, gpt-6.1-terra, openai/gpt-6.1-terra, gpt-6-luna, openai/gpt-6-luna, openai/gpt-5-1-codex, openai/gpt-5-1-codex-mini, openai/gpt-5-2-pro, openai/gpt-5-2-codex, openai/gpt-5-3-codex, openai/gpt-5-4, openai/gpt-5-4-pro, openai/gpt-5-5, openai/gpt-5-5-pro, openai/gpt-4.1, gpt-4.1, openai/gpt-4.1-2025-04-14, gpt-4.1-2025-04-14, openai/gpt-4.1-mini, gpt-4.1-mini, openai/gpt-4.1-mini-2025-04-14, gpt-4.1-mini-2025-04-14, openai/gpt-4o, gpt-4o, openai/gpt-4o-2024-08-06, gpt-4o-2024-08-06, openai/gpt-4o-2024-11-20, gpt-4o-2024-11-20, openai/gpt-4o-mini, gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, gpt-4o-mini-2024-07-18, openai/gpt-5, gpt-5, openai/gpt-5-1, openai/gpt-5.1-2025-11-13, gpt-5.1-2025-11-13, openai/gpt-5.1-codex, gpt-5.1-codex, openai/gpt-5.1-codex-mini, gpt-5.1-codex-mini, openai/gpt-5-2, openai/gpt-5-2025-08-07, gpt-5-2025-08-07, openai/gpt-5.2-2025-12-11, gpt-5.2-2025-12-11, openai/gpt-5.2-codex, gpt-5.2-codex, openai/gpt-5.3-codex, gpt-5.3-codex, openai/gpt-5.6-luna, gpt-5.6-luna, openai/gpt-5.6-sol, gpt-5.6-sol, openai/gpt-5.6-terra, gpt-5.6-terra, openai/gpt-5-mini, gpt-5-mini, openai/gpt-5-mini-2025-08-07, gpt-5-mini-2025-08-07, openai/gpt-5-nano, gpt-5-nano, openai/gpt-5-nano-2025-08-07, gpt-5-nano-2025-08-07, openai/gpt-5-pro, gpt-5-pro, openai/gpt-6.1-sol, gpt-6.1-sol, openai/gpt-6-astra, gpt-6-astra, openai/o3-2025-04-16, o3-2025-04-16, openai/o3-pro, o3-pro"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"background":{"type":"boolean","nullable":true,"description":"Whether to run the model response in the background.","example":false},"created_at":{"type":"number","description":"Unix timestamp (in seconds) of when this Response was created.","example":1762343744},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string","description":"The error code for the response."},"message":{"type":"string","description":"A human-readable description of the error."}},"required":["code","message"],"description":"An error object returned when the model fails to generate a Response.","example":null},"id":{"type":"string","description":"Unique identifier for this Response.","example":"resp_68963fb142d08197b4d3ae3ad852542c054845c6ea84caa2"},"incomplete_details":{"type":"object","nullable":true,"properties":{"reason":{"type":"string","description":"The reason why the response is incomplete."}},"description":"Details about why the response is incomplete.","example":null},"instructions":{"anyOf":[{"type":"string","description":"A text input to the model, equivalent to a text input with the developer role."},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","assistant","system","developer"],"description":"The role of the message input."},"content":{"anyOf":[{"type":"string","description":"A text input to the model."},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}],"description":"Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses."}},"required":["role","content"],"description":"A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions."},{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"The type of the message input. Always message."},"role":{"type":"string","enum":["user","system","developer"],"description":"The role of the message input."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of item."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]},"description":"A list of one or many input items to the model, containing different content types."}},"required":["role","content"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the output message."},"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the message input."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."},{"type":"object","properties":{"file_id":{"type":"string"},"index":{"type":"integer"},"type":{"type":"string","enum":["file_citation"]}},"required":["file_id","index","type"]},{"type":"object","properties":{"container_id":{"type":"string"},"start_index":{"type":"integer"},"end_index":{"type":"integer"},"file_id":{"type":"string"},"type":{"type":"string","enum":["container_file_citation"]}},"required":["container_id","start_index","end_index","file_id","type"]},{"type":"object","properties":{"file_id":{"type":"string"},"index":{"type":"integer"},"type":{"type":"string","enum":["file_path"]}},"required":["file_id","index","type"]}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["id","role","status","type","content"]},{"type":"object","properties":{"id":{"type":"string"},"queries":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["in_progress","searching","incomplete","failed","completed"]},"type":{"type":"string","enum":["file_search_call"]},"results":{"type":"array","nullable":true,"items":{"type":"object","properties":{"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"file_id":{"type":"string"},"filename":{"type":"string"},"score":{"type":"number"},"text":{"type":"string"}}}}},"required":["id","queries","status","type"]},{"type":"object","properties":{"action":{"oneOf":[{"type":"object","properties":{"button":{"type":"string","enum":["left","right","wheel","back","forward"],"description":"Indicates which mouse button was pressed during the click."},"type":{"type":"string","enum":["click"],"description":"Specifies the event type. For a click action, this property is always set to click."},"x":{"type":"integer","description":"The x-coordinate where the click occurred."},"y":{"type":"integer","description":"The y-coordinate where the click occurred."}},"required":["button","type","x","y"],"description":"A click action."},{"type":"object","properties":{"type":{"type":"string","enum":["double_click"],"description":"Specifies the event type. For a double click action, this property is always set to double_click."},"x":{"type":"integer","description":"The x-coordinate where the double click occurred."},"y":{"type":"integer","description":"The y-coordinate where the double click occurred."}},"required":["type","x","y"],"description":"A double click action."},{"type":"object","properties":{"path":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer","description":"The y-coordinate."},"y":{"type":"integer","description":"The y-coordinate."}},"required":["x","y"]},"description":"An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg"},"type":{"type":"string","enum":["drag"],"description":"Specifies the event type. For a drag action, this property is always set to drag."}},"required":["path","type"],"description":"A drag action."},{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."},"type":{"type":"string","enum":["keypress"],"description":"Specifies the event type. For a keypress action, this property is always set to keypress."}},"required":["keys","type"],"description":"A collection of keypresses the model would like to perform."},{"type":"object","properties":{"type":{"type":"string","enum":["move"],"description":"Specifies the event type. For a move action, this property is always set to move."},"x":{"type":"integer","description":"The x-coordinate to move to."},"y":{"type":"integer","description":"The y-coordinate to move to."}},"required":["type","x","y"],"description":"A mouse move action."},{"type":"object","properties":{"type":{"type":"string","enum":["screenshot"],"description":"Specifies the event type. For a screenshot action, this property is always set to screenshot."}},"required":["type"],"description":"A screenshot action."},{"type":"object","properties":{"type":{"type":"string","enum":["scroll"],"description":"Specifies the event type. For a scroll action, this property is always set to scroll."},"scroll_x":{"type":"integer","description":"The horizontal scroll distance."},"scroll_y":{"type":"integer","description":"The vertical scroll distance."},"x":{"type":"integer","description":"The x-coordinate where the scroll occurred."},"y":{"type":"integer","description":"The y-coordinate where the scroll occurred."}},"required":["type","scroll_x","scroll_y","x","y"],"description":"A scroll action."},{"type":"object","properties":{"type":{"type":"string","enum":["type"],"description":"Specifies the event type. For a type action, this property is always set to type."},"text":{"type":"string","description":"The text to type."}},"required":["type","text"],"description":"An action to type in text."},{"type":"object","properties":{"type":{"type":"string","enum":["wait"],"description":"Specifies the event type. For a wait action, this property is always set to wait."}},"required":["type"],"description":"A wait action."}]},"call_id":{"type":"string","description":"An identifier used when responding to the tool call with output."},"id":{"type":"string","description":"The unique ID of the computer call."},"pending_safety_checks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"The type of the pending safety check."},"id":{"type":"string","description":"The ID of the pending safety check."},"message":{"type":"string","description":"Details about the pending safety check."}},"required":["code","id","message"]},"description":"The pending safety checks for the computer call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."},"type":{"type":"string","enum":["computer_call"],"description":"The type of the computer call. Always computer_call."}},"required":["action","call_id","id","pending_safety_checks","status","type"]},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the computer tool call that produced the output."},"output":{"type":"object","properties":{"type":{"type":"string","enum":["computer_screenshot"],"description":"Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot."},"image_url":{"type":"string","format":"uri","description":"The URL of the screenshot image."}},"required":["type"],"description":"A computer screenshot image used with the computer use tool."},"type":{"type":"string","enum":["computer_call_output"],"description":"The type of the computer tool call output. Always computer_call_output."},"acknowledged_safety_checks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the pending safety check."},"code":{"type":"string","nullable":true,"description":"The type of the pending safety check."},"message":{"type":"string","nullable":true,"description":"Details about the pending safety check."}},"required":["id"]},"description":"The safety checks reported by the API that have been acknowledged by the developer."},"id":{"type":"string","nullable":true,"description":"The ID of the computer tool call output."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the message input."}},"required":["call_id","output","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"]},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"A JSON string of the output of the function tool call."},"type":{"type":"string","enum":["function_call_output"],"description":"The type of the function tool call output. Always function_call_output."},"id":{"type":"string","nullable":true,"description":"The unique ID of the function tool call output. Populated when this item is returned via API."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","output","type"]},{"type":"object","properties":{"call_id":{"type":"string","description":"The unique ID of the custom tool call."},"input":{"type":"string","description":"The input the model produced for the tool."},"name":{"type":"string","description":"The name of the called custom tool."},"type":{"type":"string","enum":["custom_tool_call"],"description":"The type of the item. Always `custom_tool_call`."},"id":{"type":"string","description":"The ID of the item."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["call_id","input","name","type"]},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the custom tool call this answers."},"output":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"],"description":"The type of the input item. Always input_text."},"text":{"type":"string","description":"The text input to the model."}},"required":["type","text"],"description":"A text input to the model."},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"],"description":"The type of the input item. Always input_image."},"detail":{"type":"string","enum":["high","low","auto"],"default":"auto","description":"The detail level of the image to be sent to the model. One of high, low, or auto."},"image_url":{"type":"string","nullable":true,"description":"The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"],"description":"The type of the input item. Always input_file."},"file_data":{"type":"string","description":"The content of the file to be sent to the model."},"filename":{"type":"string","description":"The name of the file to be sent to the model."}},"required":["type"]}]}}],"description":"The output of the custom tool: a string or a list of content parts."},"type":{"type":"string","enum":["custom_tool_call_output"],"description":"The type of the item. Always `custom_tool_call_output`."},"id":{"type":"string","nullable":true,"description":"The ID of the item."}},"required":["call_id","output","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["id","summary","type"]},{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string","nullable":true},"status":{"type":"string","enum":["in_progress","completed","failed","generating"]},"type":{"type":"string","enum":["image_generation_call"]}},"required":["id","result","status","type"]},{"type":"object","properties":{"code":{"type":"string","nullable":true,"description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","incomplete","interpreting","failed"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["id","status","type","container_id"]},{"type":"object","properties":{"action":{"type":"object","properties":{"command":{"type":"array","items":{"type":"string"},"description":"The command to run."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables to set for the command."},"type":{"type":"string","enum":["exec"],"description":"The type of the local shell action. Always exec."},"timeout_ms":{"type":"integer","nullable":true,"description":"Optional timeout in milliseconds for the command."},"user":{"type":"string","nullable":true,"description":"Optional user to run the command as."},"working_directory":{"type":"string","nullable":true,"description":"Optional working directory to run the command in."}},"required":["command","env","type"],"description":"Execute a shell command on the server."},"call_id":{"type":"string","description":"The unique ID of the local shell tool call generated by the model."},"id":{"type":"string","description":"The unique ID of the local shell call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the local shell call."},"type":{"type":"string","enum":["local_shell_call"],"description":"The type of the local shell call. Always local_shell_call."}},"required":["action","call_id","id","status","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the local shell tool call generated by the model."},"output":{"type":"string","description":"A JSON string of the output of the local shell tool call."},"type":{"type":"string","enum":["local_shell_call_output"],"description":"The type of the local shell tool call output. Always local_shell_call_output."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["id","output","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"nullable":true},"name":{"type":"string","description":"The name of the tool."},"annotations":{"nullable":true},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["name"]}},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"]},{"type":"object","properties":{"approval_request_id":{"type":"string","description":"The ID of the approval request being answered."},"approve":{"type":"boolean","description":"Whether the request was approved."},"type":{"type":"string","enum":["mcp_approval_response"],"description":"The type of the item. Always mcp_approval_response."},"id":{"type":"string","nullable":true,"description":"The unique ID of the approval response."},"reason":{"type":"string","nullable":true,"description":"Optional reason for the decision."}},"required":["approval_request_id","approve","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The ID of the item to reference."},"type":{"type":"string","nullable":true,"enum":["item_reference"],"description":"The type of item to reference. Always item_reference."}},"required":["id"],"description":"An internal identifier for an item to reference."}]},"description":"A list of one or many input items to the model, containing different content types."},{"nullable":true}],"description":"A system (or developer) message inserted into the model's context.","example":null},"max_output_tokens":{"type":"integer","nullable":true,"description":"An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.","example":null},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.","example":{}},"model":{"type":"string","description":"Model ID used to generate the response.","example":"gpt-5-chat-latest"},"object":{"type":"string","enum":["response"],"description":"The object type of this resource - always set to response.","example":"response"},"output":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"role":{"type":"string","enum":["assistant"],"description":"The role of the output message. Always assistant."},"type":{"type":"string","enum":["message"],"description":"The type of the output message. Always message."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"annotations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url":{"type":"string","format":"uri","description":"The URL of the web resource."}},"required":["end_index","start_index","title","type","url"],"description":"A citation for a web resource used to generate a model response."},{"type":"object","properties":{"file_id":{"type":"string"},"index":{"type":"integer"},"type":{"type":"string","enum":["file_citation"]}},"required":["file_id","index","type"]},{"type":"object","properties":{"container_id":{"type":"string"},"start_index":{"type":"integer"},"end_index":{"type":"integer"},"file_id":{"type":"string"},"type":{"type":"string","enum":["container_file_citation"]}},"required":["container_id","start_index","end_index","file_id","type"]},{"type":"object","properties":{"file_id":{"type":"string"},"index":{"type":"integer"},"type":{"type":"string","enum":["file_path"]}},"required":["file_id","index","type"]}]},"description":"The annotations of the text output."},"text":{"type":"string","description":"The text output from the model."},"type":{"type":"string","enum":["output_text"],"description":"The type of the output text. Always output_text."},"logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"}},"logprob":{"type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"]}}},"required":["bytes","logprob","token","top_logprobs"]}}},"required":["annotations","text","type"]},{"type":"object","properties":{"refusal":{"type":"string","description":"The refusal explanationfrom the model."},"type":{"type":"string","enum":["refusal"],"description":"The type of the refusal. Always refusal."}},"required":["refusal","type"]}],"description":"The content of the output message."}}},"required":["role","type","content"]},{"type":"object","properties":{"id":{"type":"string"},"queries":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["in_progress","searching","incomplete","failed","completed"]},"type":{"type":"string","enum":["file_search_call"]},"results":{"type":"array","nullable":true,"items":{"type":"object","properties":{"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"file_id":{"type":"string"},"filename":{"type":"string"},"score":{"type":"number"},"text":{"type":"string"}}}}},"required":["id","queries","status","type"]},{"type":"object","properties":{"action":{"oneOf":[{"type":"object","properties":{"button":{"type":"string","enum":["left","right","wheel","back","forward"],"description":"Indicates which mouse button was pressed during the click."},"type":{"type":"string","enum":["click"],"description":"Specifies the event type. For a click action, this property is always set to click."},"x":{"type":"integer","description":"The x-coordinate where the click occurred."},"y":{"type":"integer","description":"The y-coordinate where the click occurred."}},"required":["button","type","x","y"],"description":"A click action."},{"type":"object","properties":{"type":{"type":"string","enum":["double_click"],"description":"Specifies the event type. For a double click action, this property is always set to double_click."},"x":{"type":"integer","description":"The x-coordinate where the double click occurred."},"y":{"type":"integer","description":"The y-coordinate where the double click occurred."}},"required":["type","x","y"],"description":"A double click action."},{"type":"object","properties":{"path":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer","description":"The y-coordinate."},"y":{"type":"integer","description":"The y-coordinate."}},"required":["x","y"]},"description":"An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg"},"type":{"type":"string","enum":["drag"],"description":"Specifies the event type. For a drag action, this property is always set to drag."}},"required":["path","type"],"description":"A drag action."},{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."},"type":{"type":"string","enum":["keypress"],"description":"Specifies the event type. For a keypress action, this property is always set to keypress."}},"required":["keys","type"],"description":"A collection of keypresses the model would like to perform."},{"type":"object","properties":{"type":{"type":"string","enum":["move"],"description":"Specifies the event type. For a move action, this property is always set to move."},"x":{"type":"integer","description":"The x-coordinate to move to."},"y":{"type":"integer","description":"The y-coordinate to move to."}},"required":["type","x","y"],"description":"A mouse move action."},{"type":"object","properties":{"type":{"type":"string","enum":["screenshot"],"description":"Specifies the event type. For a screenshot action, this property is always set to screenshot."}},"required":["type"],"description":"A screenshot action."},{"type":"object","properties":{"type":{"type":"string","enum":["scroll"],"description":"Specifies the event type. For a scroll action, this property is always set to scroll."},"scroll_x":{"type":"integer","description":"The horizontal scroll distance."},"scroll_y":{"type":"integer","description":"The vertical scroll distance."},"x":{"type":"integer","description":"The x-coordinate where the scroll occurred."},"y":{"type":"integer","description":"The y-coordinate where the scroll occurred."}},"required":["type","scroll_x","scroll_y","x","y"],"description":"A scroll action."},{"type":"object","properties":{"type":{"type":"string","enum":["type"],"description":"Specifies the event type. For a type action, this property is always set to type."},"text":{"type":"string","description":"The text to type."}},"required":["type","text"],"description":"An action to type in text."},{"type":"object","properties":{"type":{"type":"string","enum":["wait"],"description":"Specifies the event type. For a wait action, this property is always set to wait."}},"required":["type"],"description":"A wait action."}]},"call_id":{"type":"string","description":"An identifier used when responding to the tool call with output."},"id":{"type":"string","description":"The unique ID of the computer call."},"pending_safety_checks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"The type of the pending safety check."},"id":{"type":"string","description":"The ID of the pending safety check."},"message":{"type":"string","description":"Details about the pending safety check."}},"required":["code","id","message"]},"description":"The pending safety checks for the computer call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."},"type":{"type":"string","enum":["computer_call"],"description":"The type of the computer call. Always computer_call."}},"required":["action","call_id","id","pending_safety_checks","status","type"]},{"type":"object","properties":{"call_id":{"type":"string","description":"The ID of the computer tool call that produced the output."},"output":{"type":"object","properties":{"type":{"type":"string","enum":["computer_screenshot"],"description":"Specifies the event type. For a computer screenshot, this property is always set to computer_screenshot."},"image_url":{"type":"string","format":"uri","description":"The URL of the screenshot image."}},"required":["type"],"description":"A computer screenshot image used with the computer use tool."},"type":{"type":"string","enum":["computer_call_output"],"description":"The type of the computer tool call output. Always computer_call_output."},"acknowledged_safety_checks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the pending safety check."},"code":{"type":"string","nullable":true,"description":"The type of the pending safety check."},"message":{"type":"string","nullable":true,"description":"Details about the pending safety check."}},"required":["id"]},"description":"The safety checks reported by the API that have been acknowledged by the developer."},"id":{"type":"string","nullable":true,"description":"The ID of the computer tool call output."},"status":{"type":"string","nullable":true,"enum":["in_progress","completed","incomplete"],"description":"The status of the message input."}},"required":["call_id","output","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the web search tool call."},"status":{"type":"string","enum":["in_progress","completed","searching","failed"],"description":"The status of the web search tool call."},"type":{"type":"string","enum":["web_search_call"],"description":"The type of the web search tool call. Always web_search_call."}},"required":["id","status","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments to pass to the function."},"call_id":{"type":"string","description":"The unique ID of the function tool call generated by the model."},"name":{"type":"string","description":"The name of the function to run."},"namespace":{"type":"string","description":"Namespace of the called tool, when it was declared inside a `namespace` tool."},"type":{"type":"string","enum":["function_call"],"description":"The type of the function tool call. Always function_call."},"id":{"type":"string","description":"The unique ID of the function tool call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["arguments","call_id","name","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the reasoning content."},"summary":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"A short summary of the reasoning used by the model when generating the response."},"type":{"type":"string","enum":["summary_text"],"description":"The type of the object. Always summary_text."}},"required":["text","type"]},"description":"Reasoning text contents."},"type":{"type":"string","enum":["reasoning"],"description":"The type of the object. Always reasoning."},"encrypted_content":{"type":"string","nullable":true,"description":"The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the item."}},"required":["id","summary","type"]},{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string","nullable":true},"status":{"type":"string","enum":["in_progress","completed","failed","generating"]},"type":{"type":"string","enum":["image_generation_call"]}},"required":["id","result","status","type"]},{"type":"object","properties":{"code":{"type":"string","nullable":true,"description":"The code to run, or null if not available."},"id":{"type":"string","description":"The unique ID of the code interpreter tool call."},"outputs":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"logs":{"type":"string","description":"The logs output from the code interpreter."},"type":{"type":"string","enum":["logs"],"description":"The type of the output. Always 'logs'."}},"required":["logs","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string"}},"required":["type","url"]}]},"description":"The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available."},"status":{"type":"string","enum":["in_progress","completed","incomplete","interpreting","failed"],"description":"The status of the code interpreter tool call."},"type":{"type":"string","enum":["code_interpreter_call"],"description":"The type of the code interpreter tool call. Always code_interpreter_call."},"container_id":{"type":"string","description":"The ID of the container used to run the code."}},"required":["id","status","type","container_id"]},{"type":"object","properties":{"action":{"type":"object","properties":{"command":{"type":"array","items":{"type":"string"},"description":"The command to run."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables to set for the command."},"type":{"type":"string","enum":["exec"],"description":"The type of the local shell action. Always exec."},"timeout_ms":{"type":"integer","nullable":true,"description":"Optional timeout in milliseconds for the command."},"user":{"type":"string","nullable":true,"description":"Optional user to run the command as."},"working_directory":{"type":"string","nullable":true,"description":"Optional working directory to run the command in."}},"required":["command","env","type"],"description":"Execute a shell command on the server."},"call_id":{"type":"string","description":"The unique ID of the local shell tool call generated by the model."},"id":{"type":"string","description":"The unique ID of the local shell call."},"status":{"type":"string","enum":["in_progress","completed","incomplete"],"description":"The status of the local shell call."},"type":{"type":"string","enum":["local_shell_call"],"description":"The type of the local shell call. Always local_shell_call."}},"required":["action","call_id","id","status","type"]},{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the list."},"server_label":{"type":"string","description":"The label of the MCP server."},"tools":{"type":"array","items":{"type":"object","properties":{"input_schema":{"nullable":true},"name":{"type":"string","description":"The name of the tool."},"annotations":{"nullable":true},"description":{"type":"string","nullable":true,"description":"The description of the tool."}},"required":["name"]}},"type":{"type":"string","enum":["mcp_list_tools"],"description":"The type of the item. Always mcp_list_tools."},"error":{"type":"string","nullable":true,"description":"Error message if the server could not list tools."}},"required":["id","server_label","tools","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of arguments for the tool."},"id":{"type":"string","description":"The unique ID of the approval request."},"name":{"type":"string"},"server_label":{"type":"string","description":"The name of the tool to run."},"type":{"type":"string","enum":["mcp_approval_request"],"description":"The type of the item. Always mcp_approval_request."}},"required":["arguments","id","name","server_label","type"]},{"type":"object","properties":{"arguments":{"type":"string","description":"A JSON string of the arguments passed to the tool."},"id":{"type":"string","description":"The unique ID of the tool call."},"name":{"type":"string","description":"The name of the tool that was run."},"server_label":{"type":"string","description":"The label of the MCP server running the tool."},"type":{"type":"string","enum":["mcp_call"],"description":"The type of the item. Always mcp_call."},"error":{"type":"string","nullable":true,"description":"The error from the tool call, if any."},"output":{"type":"string","nullable":true,"description":"The output from the tool call."}},"required":["arguments","id","name","server_label","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["x_search_call"]}},"required":["type"]}]},"description":"An array of content items generated by the model.\n- The length and order of items in the output array is dependent on the model's response.\n- Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.\n","example":null},"output_text":{"type":"string","nullable":true,"description":"SDK-only convenience property that contains the aggregated text output from all output_text items in the output array, if any are present. Supported in the Python and JavaScript SDKs.","example":"Hi! How’s your day going?"},"parallel_tool_calls":{"type":"boolean","description":"Whether to allow the model to run tool calls in parallel.","example":false},"previous_response_id":{"type":"string","nullable":true,"description":"The unique ID of the previous response to the model. Use this to create multi-turn conversations.","example":null},"prompt":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The unique identifier of the prompt template to use."},"variables":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files."},"version":{"type":"string","nullable":true,"description":"Optional version of the prompt template."}},"required":["id"],"description":"Reference to a prompt template and its variables.","example":null},"reasoning":{"type":"object","nullable":true,"properties":{"effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"summary":{"type":"string","nullable":true,"enum":["auto","concise","detailed"],"description":"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process."}},"description":"Configuration options for reasoning models.","example":null},"service_tier":{"type":"string","nullable":true,"description":"Specifies the processing type used for serving the request.","example":null},"status":{"type":"string","enum":["completed","failed","in_progress","cancelled","queued","incomplete"],"description":"The status of the response generation.","example":"completed"},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.","example":null},"text":{"type":"object","nullable":true,"properties":{"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"type":{"type":"string","enum":["json_schema"]},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name","schema","type"],"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"description":"Configuration options for a text response from the model. Can be plain text or structured JSON data."},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"],"description":"Controls which (if any) tool is called by the model.\n\nnone means the model will not call any tool and instead generates a message.\n\nauto means the model can pick between generating a message or calling one or more tools.\n\nrequired means the model must call one or more tools."},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11","computer_use_preview","code_interpreter","mcp","file_search","image_generation"]}},"required":["type"],"description":"Indicates that the model should use a built-in tool to generate a response."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"type":{"type":"string","enum":["function"],"description":"For function calling, the type is always function."}},"required":["name","type"],"description":"Use this option to force the model to call a specific function."},{"nullable":true}],"description":"How the model should select which tool (or tools) to use when generating a response.","example":null},"tools":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["web_search_preview","web_search_preview_2025_03_11"],"description":"The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11."},"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."},"city":{"type":"string","nullable":true,"description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","nullable":true,"description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","nullable":true,"description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","nullable":true,"description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"required":["type"],"description":"The user's location"}},"required":["type"],"description":"This tool searches the web for relevant results to use in a response."},{"type":"object","properties":{"display_height":{"type":"integer","description":"The height of the computer display."},"display_width":{"type":"integer","description":"The width of the computer display."},"environment":{"type":"string","enum":["windows","mac","linux","ubuntu","browser"],"description":"The type of computer environment to control."},"type":{"type":"string","enum":["computer_use_preview"],"description":"The type of the computer use tool. Always computer_use_preview."}},"required":["display_height","display_width","environment","type"],"description":"A tool that controls a virtual computer."},{"type":"object","properties":{"server_label":{"type":"string","description":"A label for this MCP server, used to identify it in tool calls."},"server_url":{"type":"string","description":"The URL for the MCP server."},"type":{"type":"string","enum":["mcp"],"description":"The type of the MCP tool. Always mcp."},"allowed_tools":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"A string array of allowed tool names."},{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of allowed tool names."}},"description":"A filter object to specify which tools are allowed."},{"nullable":true}],"description":"List of allowed tool names or a filter object."},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Optional HTTP headers to send to the MCP server. Use for authentication or other purposes."},"require_approval":{"anyOf":[{"type":"string","enum":["always","never"]},{"type":"object","properties":{"always":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that require approval."}},"description":"A list of tools that always require approval."},"never":{"type":"object","properties":{"tool_names":{"type":"array","items":{"type":"string"},"description":"List of tools that do not require approval."}},"description":"A list of tools that never require approval."}}},{"nullable":true}],"description":"Specify which of the MCP server's tools require approval."}},"required":["server_label","server_url","type"],"description":"Give the model access to additional tools via remote Model Context Protocol (MCP) servers."},{"type":"object","properties":{"type":{"type":"string","enum":["code_interpreter"],"description":"The type of the code interpreter tool. Always code_interpreter."},"container":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]}],"description":"The container ID."}},"required":["type","container"],"description":"A tool that runs Python code to help generate a response to a prompt."},{"type":"object","properties":{"type":{"type":"string","enum":["local_shell"],"description":"The type of the local shell tool. Always local_shell."}},"required":["type"],"description":"A tool that allows the model to execute shell commands in a local environment."},{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call."},"parameters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"A JSON schema object describing the parameters of the function."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enforce strict parameter validation."},"type":{"type":"string","enum":["function"],"description":"The type of the function tool. Always function."},"description":{"type":"string","nullable":true,"description":"A description of the function. Used by the model to determine whether or not to call the function."}},"required":["name","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_generation"]},"background":{"type":"string","enum":["transparent","opaque","auto"]},"input_image_mask":{"type":"object","properties":{"file_id":{"type":"string"},"image_url":{"type":"string"}}},"model":{"type":"string","enum":["gpt-image-1"]},"moderation":{"type":"string","enum":["auto","low"]},"output_compression":{"type":"number"},"output_format":{"type":"string","enum":["png","webp","jpeg"]},"partial_images":{"type":"integer","minimum":0,"maximum":3},"quality":{"type":"string","enum":["low","medium","high","auto"]},"size":{"type":"string","enum":["1024x1024","1024x1536","1536x1024","auto"]}},"required":["type"]}]},"description":"An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter.","example":null},"top_p":{"type":"number","nullable":true,"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\nWe generally recommend altering this or temperature but not both.","example":null},"truncation":{"type":"string","nullable":true,"enum":["auto","disabled"],"description":"The truncation strategy to use for the model response.\n- auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.\n- disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.\n","example":null},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","description":"The number of input tokens.","example":137},"input_tokens_details":{"type":"object","nullable":true,"properties":{"cached_tokens":{"type":"integer","description":"The number of tokens that were retrieved from the cache."}},"required":["cached_tokens"],"description":"A detailed breakdown of the input tokens.","example":null},"output_tokens":{"type":"integer","description":"The number of output tokens.","example":914},"output_tokens_details":{"type":"object","nullable":true,"properties":{"reasoning_tokens":{"type":"integer","description":"The number of reasoning tokens."}},"required":["reasoning_tokens"],"description":"A detailed breakdown of the output tokens.","example":null},"total_tokens":{"type":"integer","description":"The total number of tokens used.","example":1051}},"required":["input_tokens","output_tokens","total_tokens"],"description":"Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used."},"citations":{"type":"array","items":{"type":"string","format":"uri"}},"server_side_tool_usage":{"type":"object","additionalProperties":{"type":"integer","minimum":0}},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["created_at","id","model","object","parallel_tool_calls"]}}}}}}},"/v1/chat/completions":{"post":{"operationId":"_v1_chat_completions","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.4-2026-03-05","openai/gpt-5.4-2026-03-05","gpt-5.5-2026-04-23","openai/gpt-5.5-2026-04-23","gpt-6-sol","openai/gpt-6-sol","gpt-6-luna","openai/gpt-6-luna","openai/gpt-5-4","openai/gpt-5-5","openai/gpt-5.6-luna","gpt-5.6-luna","openai/gpt-5.6-sol","gpt-5.6-sol","openai/gpt-5.6-terra","gpt-5.6-terra"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"gpt-5.4-2026-03-05, openai/gpt-5.4-2026-03-05, gpt-5.5-2026-04-23, openai/gpt-5.5-2026-04-23, gpt-6-sol, openai/gpt-6-sol, gpt-6-luna, openai/gpt-6-luna, openai/gpt-5-4, openai/gpt-5-5, openai/gpt-5.6-luna, gpt-5.6-luna, openai/gpt-5.6-sol, gpt-5.6-sol, openai/gpt-5.6-terra, gpt-5.6-terra"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-6.1-terra","openai/gpt-6.1-terra","openai/gpt-6.1-sol","gpt-6.1-sol"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"gpt-6.1-terra, openai/gpt-6.1-terra, openai/gpt-6.1-sol, gpt-6.1-sol"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-6.1-terra-pro","openai/gpt-6.1-terra-pro","gpt-6.1-terra","openai/gpt-6.1-terra","openai/gpt-6.1-sol","gpt-6.1-sol"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"gpt-6.1-terra-pro, openai/gpt-6.1-terra-pro, gpt-6.1-terra, openai/gpt-6.1-terra, openai/gpt-6.1-sol, gpt-6.1-sol"},{"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","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":32000,"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, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5"},{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","anthropic/claude-sonnet-4-6","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":32000,"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."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"claude-sonnet-4-6, anthropic/claude-sonnet-4-6, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6"},{"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-opus-5","anthropic/claude-opus-5","claude-fable-5-1","anthropic/claude-fable-5-1","claude-opus-5-5","anthropic/claude-opus-5-5","claude-sonnet-5-5","anthropic/claude-sonnet-5-5","claude-haiku-5-5","anthropic/claude-haiku-5-5","claude-fable-5-2","anthropic/claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-sonnet-5","claude-sonnet-5"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"claude-opus-4-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-opus-5, anthropic/claude-opus-5, claude-fable-5-1, anthropic/claude-fable-5-1, claude-opus-5-5, anthropic/claude-opus-5-5, claude-sonnet-5-5, anthropic/claude-sonnet-5-5, claude-haiku-5-5, anthropic/claude-haiku-5-5, claude-fable-5-2, anthropic/claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-sonnet-5, claude-sonnet-5"},{"type":"object","properties":{"model":{"type":"string","enum":["claude-opus-5","anthropic/claude-opus-5","anthropic/claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929","anthropic/claude-haiku-4-5-20251001","claude-haiku-4-5-20251001","anthropic/claude-opus-4-5-20251101","claude-opus-4-5-20251101","anthropic/claude-opus-4-6","claude-opus-4-6","anthropic/claude-sonnet-4-6","claude-sonnet-4-6","anthropic/claude-opus-4-7","claude-opus-4-7","anthropic/claude-opus-4-8","claude-opus-4-8","anthropic/claude-haiku-5-5","claude-haiku-5-5","anthropic/claude-haiku-5.5","aion-labs/aion-rp-llama-3.1-8b","aion-rp-llama-3.1-8b","amazon/nova-2-lite-v1","nova-2-lite-v1","amazon/nova-lite-v1","nova-lite-v1","amazon/nova-micro-v1","nova-micro-v1","amazon/nova-premier-v1","nova-premier-v1","amazon/nova-pro-v1","nova-pro-v1","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-haiku-latest","claude-haiku-latest","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-opus-4.6","claude-opus-4.6","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-sonnet-4","claude-sonnet-4","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6","anthropic/claude-sonnet-5","claude-sonnet-5","bytedance-seed/seed-1.6","seed-1.6","bytedance-seed/seed-1.6-flash","seed-1.6-flash","bytedance-seed/seed-2.0-lite","seed-2.0-lite","bytedance-seed/seed-2.0-mini","seed-2.0-mini","bytedance-seed/seed-2-1-turbo","seed-2-1-turbo","cognitivecomputations/dolphin-mistral-24b-venice-edition","dolphin-mistral-24b-venice-edition","cohere/command-r-08-2024","command-r-08-2024","cohere/command-r7b-12-2024","command-r7b-12-2024","cohere/command-r-plus-08-2024","command-r-plus-08-2024","deepseek/deepseek-v4-flash-latest","deepseek-v4-flash-latest","google/gemini-2.5-flash-image","gemini-2.5-flash-image","google/gemini-2.5-flash-lite","gemini-2.5-flash-lite","google/gemini-2.5-flash-lite-preview","gemini-2.5-flash-lite-preview","google/gemini-3.1-flash-image","gemini-3.1-flash-image","google/gemini-3-1-flash-image-preview","google/nano-banana-2","google/gemini-3.1-flash-image-preview","gemini-3.1-flash-image-preview","google/gemini-3-1-flash-lite","google/gemini-3.1-flash-lite","gemini-3.1-flash-lite","google/gemini-3.1-flash-lite-image","gemini-3.1-flash-lite-image","google/gemini-3-1-flash-lite-preview","google/gemini-3.1-flash-lite-preview","gemini-3.1-flash-lite-preview","google/gemma-2-27b-it","gemma-2-27b-it","inception/mercury-2","mercury-2","inception/mercury-2.5","mercury-2.5","mancer/weaver","weaver","mistralai/codestral-2508","codestral-2508","mistralai/ministral-14b-2512","ministral-14b-2512","mistralai/ministral-3b-2512","ministral-3b-2512","mistralai/ministral-8b-2512","ministral-8b-2512","mistralai/mistral-large","mistral-large","mistralai/mistral-large-2407","mistral-large-2407","mistralai/mistral-medium-3","mistral-medium-3","mistralai/mistral-medium-3.1","mistral-medium-3.1","mistralai/mistral-medium-3-5","mistral-medium-3-5","mistralai/mistral-saba","mistral-saba","mistralai/mistral-small-24b-instruct-2501","mistral-small-24b-instruct-2501","mistralai/mistral-small-2603","mistral-small-2603","mistralai/mistral-small-3.1-24b-instruct","mistral-small-3.1-24b-instruct","mistralai/mistral-small-3.2-24b-instruct","mistral-small-3.2-24b-instruct","mistralai/mixtral-8x22b-instruct","mixtral-8x22b-instruct","mistralai/voxtral-small-24b-2507","voxtral-small-24b-2507","moonshotai/kimi-k2","kimi-k2","moonshotai/kimi-k2-0905","kimi-k2-0905","moonshotai/kimi-k2.5","kimi-k2.5","moonshotai/kimi-k2.6","kimi-k2.6","moonshotai/kimi-latest","kimi-latest","morph/morph-v3-fast","morph-v3-fast","morph/morph-v3-large","morph-v3-large","nousresearch/hermes-3-llama-3.1-405b","hermes-3-llama-3.1-405b","nousresearch/hermes-3-llama-3.1-70b","hermes-3-llama-3.1-70b","openai/gpt-4.1-mini","gpt-4.1-mini","openai/gpt-5.1","gpt-5.1","openai/gpt-5.2","gpt-5.2","openai/gpt-5.2-chat","gpt-5.2-chat","openai/gpt-5.3-codex","gpt-5.3-codex","openai/gpt-5.4","gpt-5.4","openai/gpt-5.4-image-2","gpt-5.4-image-2","openai/gpt-5.4-mini","gpt-5.4-mini","openai/gpt-5.4-nano","gpt-5.4-nano","openai/gpt-5.5","gpt-5.5","openai/gpt-audio","gpt-audio","openai/gpt-audio-mini","gpt-audio-mini","openai/gpt-chat-latest","gpt-chat-latest","openai/gpt-latest","gpt-latest","openai/gpt-mini-latest","gpt-mini-latest","perceptron/perceptron-mk1","perceptron-mk1","poolside/laguna-s-2.1","laguna-s-2.1","poolside/laguna-xs-2.1","laguna-xs-2.1","rekaai/reka-edge","reka-edge","relace/relace-apply-3","relace-apply-3","relace/relace-search","relace-search","sao10k/l3.1-euryale-70b","l3.1-euryale-70b","sao10k/l3-lunaris-8b","l3-lunaris-8b","tencent/hy3","hy3","thedrummer/cydonia-24b-v4.1","cydonia-24b-v4.1","thedrummer/skyfall-36b-v2","skyfall-36b-v2","thedrummer/unslopnemo-12b","unslopnemo-12b","undi95/remm-slerp-l2-13b","remm-slerp-l2-13b","upstage/solar-pro4","solar-pro4","writer/palmyra-x5","palmyra-x5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"claude-opus-5, anthropic/claude-opus-5, anthropic/claude-sonnet-4-5-20250929, claude-sonnet-4-5-20250929, anthropic/claude-haiku-4-5-20251001, claude-haiku-4-5-20251001, anthropic/claude-opus-4-5-20251101, claude-opus-4-5-20251101, anthropic/claude-opus-4-6, claude-opus-4-6, anthropic/claude-sonnet-4-6, claude-sonnet-4-6, anthropic/claude-opus-4-7, claude-opus-4-7, anthropic/claude-opus-4-8, claude-opus-4-8, anthropic/claude-haiku-5-5, claude-haiku-5-5, anthropic/claude-haiku-5.5, aion-labs/aion-rp-llama-3.1-8b, aion-rp-llama-3.1-8b, amazon/nova-2-lite-v1, nova-2-lite-v1, amazon/nova-lite-v1, nova-lite-v1, amazon/nova-micro-v1, nova-micro-v1, amazon/nova-premier-v1, nova-premier-v1, amazon/nova-pro-v1, nova-pro-v1, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-haiku-latest, claude-haiku-latest, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-opus-4.6, claude-opus-4.6, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-sonnet-4, claude-sonnet-4, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6, anthropic/claude-sonnet-5, claude-sonnet-5, bytedance-seed/seed-1.6, seed-1.6, bytedance-seed/seed-1.6-flash, seed-1.6-flash, bytedance-seed/seed-2.0-lite, seed-2.0-lite, bytedance-seed/seed-2.0-mini, seed-2.0-mini, bytedance-seed/seed-2-1-turbo, seed-2-1-turbo, cognitivecomputations/dolphin-mistral-24b-venice-edition, dolphin-mistral-24b-venice-edition, cohere/command-r-08-2024, command-r-08-2024, cohere/command-r7b-12-2024, command-r7b-12-2024, cohere/command-r-plus-08-2024, command-r-plus-08-2024, deepseek/deepseek-v4-flash-latest, deepseek-v4-flash-latest, google/gemini-2.5-flash-image, gemini-2.5-flash-image, google/gemini-2.5-flash-lite, gemini-2.5-flash-lite, google/gemini-2.5-flash-lite-preview, gemini-2.5-flash-lite-preview, google/gemini-3.1-flash-image, gemini-3.1-flash-image, google/gemini-3-1-flash-image-preview, google/nano-banana-2, google/gemini-3.1-flash-image-preview, gemini-3.1-flash-image-preview, google/gemini-3-1-flash-lite, google/gemini-3.1-flash-lite, gemini-3.1-flash-lite, google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image, google/gemini-3-1-flash-lite-preview, google/gemini-3.1-flash-lite-preview, gemini-3.1-flash-lite-preview, google/gemma-2-27b-it, gemma-2-27b-it, inception/mercury-2, mercury-2, inception/mercury-2.5, mercury-2.5, mancer/weaver, weaver, mistralai/codestral-2508, codestral-2508, mistralai/ministral-14b-2512, ministral-14b-2512, mistralai/ministral-3b-2512, ministral-3b-2512, mistralai/ministral-8b-2512, ministral-8b-2512, mistralai/mistral-large, mistral-large, mistralai/mistral-large-2407, mistral-large-2407, mistralai/mistral-medium-3, mistral-medium-3, mistralai/mistral-medium-3.1, mistral-medium-3.1, mistralai/mistral-medium-3-5, mistral-medium-3-5, mistralai/mistral-saba, mistral-saba, mistralai/mistral-small-24b-instruct-2501, mistral-small-24b-instruct-2501, mistralai/mistral-small-2603, mistral-small-2603, mistralai/mistral-small-3.1-24b-instruct, mistral-small-3.1-24b-instruct, mistralai/mistral-small-3.2-24b-instruct, mistral-small-3.2-24b-instruct, mistralai/mixtral-8x22b-instruct, mixtral-8x22b-instruct, mistralai/voxtral-small-24b-2507, voxtral-small-24b-2507, moonshotai/kimi-k2, kimi-k2, moonshotai/kimi-k2-0905, kimi-k2-0905, moonshotai/kimi-k2.5, kimi-k2.5, moonshotai/kimi-k2.6, kimi-k2.6, moonshotai/kimi-latest, kimi-latest, morph/morph-v3-fast, morph-v3-fast, morph/morph-v3-large, morph-v3-large, nousresearch/hermes-3-llama-3.1-405b, hermes-3-llama-3.1-405b, nousresearch/hermes-3-llama-3.1-70b, hermes-3-llama-3.1-70b, openai/gpt-4.1-mini, gpt-4.1-mini, openai/gpt-5.1, gpt-5.1, openai/gpt-5.2, gpt-5.2, openai/gpt-5.2-chat, gpt-5.2-chat, openai/gpt-5.3-codex, gpt-5.3-codex, openai/gpt-5.4, gpt-5.4, openai/gpt-5.4-image-2, gpt-5.4-image-2, openai/gpt-5.4-mini, gpt-5.4-mini, openai/gpt-5.4-nano, gpt-5.4-nano, openai/gpt-5.5, gpt-5.5, openai/gpt-audio, gpt-audio, openai/gpt-audio-mini, gpt-audio-mini, openai/gpt-chat-latest, gpt-chat-latest, openai/gpt-latest, gpt-latest, openai/gpt-mini-latest, gpt-mini-latest, perceptron/perceptron-mk1, perceptron-mk1, poolside/laguna-s-2.1, laguna-s-2.1, poolside/laguna-xs-2.1, laguna-xs-2.1, rekaai/reka-edge, reka-edge, relace/relace-apply-3, relace-apply-3, relace/relace-search, relace-search, sao10k/l3.1-euryale-70b, l3.1-euryale-70b, sao10k/l3-lunaris-8b, l3-lunaris-8b, tencent/hy3, hy3, thedrummer/cydonia-24b-v4.1, cydonia-24b-v4.1, thedrummer/skyfall-36b-v2, skyfall-36b-v2, thedrummer/unslopnemo-12b, unslopnemo-12b, undi95/remm-slerp-l2-13b, remm-slerp-l2-13b, upstage/solar-pro4, solar-pro4, writer/palmyra-x5, palmyra-x5"},{"type":"object","properties":{"model":{"type":"string","enum":["anthropic/claude-fable-5-1","claude-fable-5-1","anthropic/claude-opus-5-5","claude-opus-5-5","anthropic/claude-sonnet-5-5","claude-sonnet-5-5","anthropic/claude-fable-5-2","claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-fable-5.2","aion-labs/aion-2.0","aion-2.0","aion-labs/aion-3.0","aion-3.0","aion-labs/aion-3.0-mini","aion-3.0-mini","aion-labs/aion-3.5","aion-3.5","aion-labs/aion-3.5-mini","aion-3.5-mini","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-fable-latest","claude-fable-latest","anthropic/claude-opus-latest","claude-opus-latest","anthropic/claude-sonnet-latest","claude-sonnet-latest","google/gemini-2.5-pro-preview","gemini-2.5-pro-preview","google/gemini-3.1-pro-preview-customtools","gemini-3.1-pro-preview-customtools","google/gemini-3-5-flash","gemini-3-5-flash","google/gemini-3.5-flash","gemini-3.5-flash","google/gemini-3-5-flash-lite","gemini-3-5-flash-lite","google/gemini-3.5-flash-lite","gemini-3.5-flash-lite","google/gemini-3-6-flash","gemini-3-6-flash","google/gemini-3.6-flash","gemini-3.6-flash","google/gemini-3-7-flash","gemini-3-7-flash","google/gemini-3.7-flash","gemini-3.7-flash","google/gemini-3-pro-image","gemini-3-pro-image","google/gemini-3-pro-image-preview","google/gemini-flash-latest","gemini-flash-latest","google/gemini-pro-latest","gemini-pro-latest","meta/muse-spark-1.1","muse-spark-1.1","meta/muse-spark-1.2","muse-spark-1.2","meta/muse-spark-1.3","muse-spark-1.3","moonshotai/kimi-k2.7-code","kimi-k2.7-code","moonshotai/kimi-k2-thinking","kimi-k2-thinking","openai/gpt-5.1-codex","gpt-5.1-codex","openai/gpt-5.1-codex-max","gpt-5.1-codex-max","openai/gpt-5.1-codex-mini","gpt-5.1-codex-mini","openai/gpt-5.2-codex","gpt-5.2-codex","openai/gpt-5.2-pro","gpt-5.2-pro","openai/gpt-5.4-pro","gpt-5.4-pro","openai/gpt-5.5-pro","gpt-5.5-pro","openai/gpt-5-image","gpt-5-image","openai/gpt-5-image-mini","gpt-5-image-mini","openai/gpt-5-pro","gpt-5-pro","openai/gpt-oss-safeguard-20b","gpt-oss-safeguard-20b","openai/o3","o3","openai/o3-pro","o3-pro","rekaai/reka-flash-3","reka-flash-3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"anthropic/claude-fable-5-1, claude-fable-5-1, anthropic/claude-opus-5-5, claude-opus-5-5, anthropic/claude-sonnet-5-5, claude-sonnet-5-5, anthropic/claude-fable-5-2, claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-fable-5.2, aion-labs/aion-2.0, aion-2.0, aion-labs/aion-3.0, aion-3.0, aion-labs/aion-3.0-mini, aion-3.0-mini, aion-labs/aion-3.5, aion-3.5, aion-labs/aion-3.5-mini, aion-3.5-mini, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-fable-latest, claude-fable-latest, anthropic/claude-opus-latest, claude-opus-latest, anthropic/claude-sonnet-latest, claude-sonnet-latest, google/gemini-2.5-pro-preview, gemini-2.5-pro-preview, google/gemini-3.1-pro-preview-customtools, gemini-3.1-pro-preview-customtools, google/gemini-3-5-flash, gemini-3-5-flash, google/gemini-3.5-flash, gemini-3.5-flash, google/gemini-3-5-flash-lite, gemini-3-5-flash-lite, google/gemini-3.5-flash-lite, gemini-3.5-flash-lite, google/gemini-3-6-flash, gemini-3-6-flash, google/gemini-3.6-flash, gemini-3.6-flash, google/gemini-3-7-flash, gemini-3-7-flash, google/gemini-3.7-flash, gemini-3.7-flash, google/gemini-3-pro-image, gemini-3-pro-image, google/gemini-3-pro-image-preview, google/gemini-flash-latest, gemini-flash-latest, google/gemini-pro-latest, gemini-pro-latest, meta/muse-spark-1.1, muse-spark-1.1, meta/muse-spark-1.2, muse-spark-1.2, meta/muse-spark-1.3, muse-spark-1.3, moonshotai/kimi-k2.7-code, kimi-k2.7-code, moonshotai/kimi-k2-thinking, kimi-k2-thinking, openai/gpt-5.1-codex, gpt-5.1-codex, openai/gpt-5.1-codex-max, gpt-5.1-codex-max, openai/gpt-5.1-codex-mini, gpt-5.1-codex-mini, openai/gpt-5.2-codex, gpt-5.2-codex, openai/gpt-5.2-pro, gpt-5.2-pro, openai/gpt-5.4-pro, gpt-5.4-pro, openai/gpt-5.5-pro, gpt-5.5-pro, openai/gpt-5-image, gpt-5-image, openai/gpt-5-image-mini, gpt-5-image-mini, openai/gpt-5-pro, gpt-5-pro, openai/gpt-oss-safeguard-20b, gpt-oss-safeguard-20b, openai/o3, o3, openai/o3-pro, o3-pro, rekaai/reka-flash-3, reka-flash-3"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seed-2-0-pro","bytedance/seed-2-0-code-preview","bytedance/dola-seed-2-0-pro","bytedance/dola-seed-2-0-code"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["video_url"],"description":"The type of the content part."},"video_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Either a URL of the video or the base64 encoded video data."}},"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"bytedance/seed-2-0-pro, bytedance/seed-2-0-code-preview, bytedance/dola-seed-2-0-pro, bytedance/dola-seed-2-0-code"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek-chat","deepseek/deepseek-chat"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"deepseek-chat, deepseek/deepseek-chat"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek-chat","deepseek/deepseek-chat"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek-chat, deepseek/deepseek-chat"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek-reasoner","deepseek/deepseek-reasoner"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."}},"required":["model","messages"],"title":"deepseek-reasoner, deepseek/deepseek-reasoner"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek-reasoner","deepseek/deepseek-reasoner"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek-reasoner, deepseek/deepseek-reasoner"},{"type":"object","properties":{"model":{"type":"string","enum":["longcat-2.0","meituan/longcat-2.0"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":1,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Set to `enabled` to turn on deep-thinking, or `disabled` to turn it off."}},"required":["type"],"description":"Controls LongCat-2.0 deep-thinking (reasoning) mode."}},"required":["model","messages"],"title":"longcat-2.0, meituan/longcat-2.0"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-4-hydrogen","google/gemini-4-hydrogen","google/gemini-4-argon","gemini-4-argon","google/gemini-4-carbon","gemini-4-carbon"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"gemini-4-hydrogen, google/gemini-4-hydrogen, google/gemini-4-argon, gemini-4-argon, google/gemini-4-carbon, gemini-4-carbon"},{"type":"object","properties":{"model":{"type":"string","enum":["muse-ember","meta/muse-ember","meta/muse-wonder","muse-wonder"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"muse-ember, meta/muse-ember, meta/muse-wonder, muse-wonder"},{"type":"object","properties":{"model":{"type":"string","enum":["mistral-large-2512","mistralai/mistral-large-2512"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"mistral-large-2512, mistralai/mistral-large-2512"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/glm-5.2","glm-5.2-fast-preview","alibaba/glm-5.2-fast-preview","zhipu/glm-5-2-fast-preview","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."}},"required":["model","messages"],"title":"alibaba/glm-5.2, glm-5.2-fast-preview, alibaba/glm-5.2-fast-preview, zhipu/glm-5-2-fast-preview, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen-max","alibaba/qwen-max","qwen-turbo","alibaba/qwen-turbo"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."}},"required":["model","messages"],"title":"qwen-max, alibaba/qwen-max, qwen-turbo, alibaba/qwen-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.5-flash","alibaba/qwen3.5-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."}},"required":["model","messages"],"title":"qwen3.5-flash, alibaba/qwen3.5-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.5-plus","alibaba/qwen3.5-plus","qwen3.6-plus","alibaba/qwen3.6-plus","qwen3.6-flash","alibaba/qwen3.6-flash","alibaba/qwen3.5-plus-20260218"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"enable_thinking":{"type":"boolean","description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."}},"required":["model","messages"],"title":"qwen3.5-plus, alibaba/qwen3.5-plus, qwen3.6-plus, alibaba/qwen3.6-plus, qwen3.6-flash, alibaba/qwen3.6-flash, alibaba/qwen3.5-plus-20260218"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3-max-preview","alibaba/qwen3-max-preview","qwen3-max","alibaba/qwen3-max"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."}},"required":["model","messages"],"title":"qwen3-max-preview, alibaba/qwen3-max-preview, qwen3-max, alibaba/qwen3-max"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3-vl-plus","alibaba/qwen3-vl-plus","qwen3-vl-flash","alibaba/qwen3-vl-flash","qwen3.7-plus","alibaba/qwen3.7-plus"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."}},"required":["model","messages"],"title":"qwen3-vl-plus, alibaba/qwen3-vl-plus, qwen3-vl-flash, alibaba/qwen3-vl-flash, qwen3.7-plus, alibaba/qwen3.7-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3-vl-32b-thinking","alibaba/qwen3-vl-32b-thinking","qwen3-vl-32b-instruct","alibaba/qwen3-vl-32b-instruct"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."}},"required":["model","messages"],"title":"qwen3-vl-32b-thinking, alibaba/qwen3-vl-32b-thinking, qwen3-vl-32b-instruct, alibaba/qwen3-vl-32b-instruct"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3-omni-30b-a3b-captioner","alibaba/qwen3-omni-30b-a3b-captioner"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"role":{"type":"string","enum":["user"],"description":"The role of the author of the message — in this case, the user"},"content":{"type":"array","items":{"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"}],"description":"Base64 encoded audio data."},"format":{"type":"string","description":"The format of the encoded audio data. Currently supports \"wav\" and \"mp3\"."}},"required":["data"]}},"required":["type","input_audio"]},"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"]}]},"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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]}},"required":["model","messages"],"title":"qwen3-omni-30b-a3b-captioner, alibaba/qwen3-omni-30b-a3b-captioner"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.5-omni-plus","alibaba/qwen3.5-omni-plus"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":["video_url"],"description":"The type of the content part."},"video_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Either a URL of the video or the base64 encoded video data."}},"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"qwen3.5-omni-plus, alibaba/qwen3.5-omni-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.5-omni-flash","alibaba/qwen3.5-omni-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":["video_url"],"description":"The type of the content part."},"video_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Either a URL of the video or the base64 encoded video data."}},"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"enable_thinking":{"type":"boolean","enum":[false],"default":false,"description":"This model has no thinking mode: only `false` is taken."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"qwen3.5-omni-flash, alibaba/qwen3.5-omni-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.8-omni-flash","alibaba/qwen3.8-omni-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["input_audio"],"description":"The type of the content part."},"input_audio":{"type":"object","properties":{"data":{"anyOf":[{"type":"string","format":"uri"},{"type":"string"}],"description":"Base64 encoded audio data."},"format":{"type":"string","description":"The format of the encoded audio data. Currently supports \"wav\" and \"mp3\"."}},"required":["data"]}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","enum":["video_url"],"description":"The type of the content part."},"video_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Either a URL of the video or the base64 encoded video data."}},"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"qwen3.8-omni-flash, alibaba/qwen3.8-omni-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.6-max-preview","alibaba/qwen3.6-max-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."}},"required":["model","messages"],"title":"qwen3.6-max-preview, alibaba/qwen3.6-max-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.7-max","alibaba/qwen3.7-max"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"qwen3.7-max, alibaba/qwen3.7-max"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.8-max","alibaba/qwen3.8-max","qwen3.8-flash","alibaba/qwen3.8-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"qwen3.8-max, alibaba/qwen3.8-max, qwen3.8-flash, alibaba/qwen3.8-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen4-max","alibaba/qwen4-max"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["video_url"],"description":"The type of the content part."},"video_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Either a URL of the video or the base64 encoded video data."}},"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":["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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"qwen4-max, alibaba/qwen4-max"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3.6-27b","alibaba/qwen3.6-27b","qwen3.6-35b-a3b","alibaba/qwen3.6-35b-a3b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"qwen3.6-27b, alibaba/qwen3.6-27b, qwen3.6-35b-a3b, alibaba/qwen3.6-35b-a3b"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen4-max","qwen4-max"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen4-max, qwen4-max"},{"type":"object","properties":{"model":{"type":"string","enum":["test/dummy"]},"stream":{"type":"boolean"},"test":{"type":"object","properties":{"credits":{"type":"number"},"delay":{"type":"number"},"errorStatus":{"type":"number"}}}},"required":["model"],"title":"test/dummy"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2","MiniMax-M2","minimax/m1","minimax-m1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":1,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"minimax/m2, MiniMax-M2, minimax/m1, minimax-m1"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2-her","MiniMax M2-her"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."}},"required":["model","messages"],"title":"minimax/m2-her, MiniMax M2-her"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2-1","MiniMax-M2.1","minimax/m2-5-20260218","MiniMax-M2.5","minimax/m2-5-highspeed-20260218","MiniMax-M2.5-Highspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"minimax/m2-1, MiniMax-M2.1, minimax/m2-5-20260218, MiniMax-M2.5, minimax/m2-5-highspeed-20260218, MiniMax-M2.5-Highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2-1-highspeed","MiniMax-M2.1-Highspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"minimax/m2-1-highspeed, MiniMax-M2.1-Highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/minimax-m3","MiniMax-M3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"}},"required":["model","messages"],"title":"minimax/minimax-m3, MiniMax-M3"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2-7-20260402","MiniMax-M2.7"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."}},"required":["model","messages"],"title":"minimax/m2-7-20260402, MiniMax-M2.7"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m2-7-highspeed","MiniMax-M2.7-Highspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"minimax/m2-7-highspeed, MiniMax-M2.7-Highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k2-5","kimi-k2-5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["function","builtin_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":{"anyOf":[{"type":"string","enum":["$web_search"]},{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."},"required":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. Only the provider default value is supported for this model."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"moonshot/kimi-k2-5, kimi-k2-5"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k2-6"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["function","builtin_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":{"anyOf":[{"type":"string","enum":["$web_search"]},{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."},"required":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Set to `disabled` to turn deep thinking off. Moonshot rejects a required or named `tool_choice` while thinking is enabled."}},"required":["type"],"description":"Controls Moonshot deep-thinking (reasoning) mode."}},"required":["model","messages"],"title":"moonshot/kimi-k2-6"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k2-7-code","kimi-k2-7-code","moonshot/kimi-k2-7-code-highspeed","kimi-k2-7-code-highspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["function","builtin_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":{"anyOf":[{"type":"string","enum":["$web_search"]},{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."},"required":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"moonshot/kimi-k2-7-code, kimi-k2-7-code, moonshot/kimi-k2-7-code-highspeed, kimi-k2-7-code-highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k3-1-pro","moonshot/kimi-k3.1-pro","moonshot/kimi-k3-1-pro-highspeed","moonshot/kimi-k3.1-pro-highspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"moonshot/kimi-k3-1-pro, moonshot/kimi-k3.1-pro, moonshot/kimi-k3-1-pro-highspeed, moonshot/kimi-k3.1-pro-highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["ernie-5.0","baidu/ernie-5.0"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"enable_thinking":{"type":"boolean","description":"Enable ERNIE deep-thinking mode. When omitted, the model default applies (enabled for ERNIE 5.0)."},"thinking_budget":{"type":"integer","minimum":100,"description":"Maximum chain-of-thought length in tokens; effective only when enable_thinking is true (minimum 100)."}},"required":["model","messages"],"title":"ernie-5.0, baidu/ernie-5.0"},{"type":"object","properties":{"model":{"type":"string","enum":["baidu/ernie-5.5-flash-preview","ernie-5.5-flash-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"baidu/ernie-5.5-flash-preview, ernie-5.5-flash-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["sonar","perplexity/sonar","sonar-pro","perplexity/sonar-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"top_k":{"type":"number","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."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"}},"required":["model","messages"],"title":"sonar, perplexity/sonar, sonar-pro, perplexity/sonar-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-3-beta","grok-3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"x-ai/grok-3-beta, grok-3"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-3-mini-beta","grok-3-mini","x-ai/grok-code-fast-1","grok-code-fast-1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"x-ai/grok-3-mini-beta, grok-3-mini, x-ai/grok-code-fast-1, grok-code-fast-1"},{"type":"object","properties":{"model":{"type":"string","enum":["grok-4-fast-reasoning","x-ai/grok-4-fast-reasoning","grok-4-1-fast-reasoning","x-ai/grok-4-1-fast-reasoning"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"grok-4-fast-reasoning, x-ai/grok-4-fast-reasoning, grok-4-1-fast-reasoning, x-ai/grok-4-1-fast-reasoning"},{"type":"object","properties":{"model":{"type":"string","enum":["grok-4-fast-non-reasoning","x-ai/grok-4-fast-non-reasoning","grok-4-1-fast-non-reasoning","x-ai/grok-4-1-fast-non-reasoning"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."}},"required":["model","messages"],"title":"grok-4-fast-non-reasoning, x-ai/grok-4-fast-non-reasoning, grok-4-1-fast-non-reasoning, x-ai/grok-4-1-fast-non-reasoning"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-4-3","grok-4-3","x-ai/grok-4-20-0309-non-reasoning","grok-4-20-0309-non-reasoning","x-ai/grok-4-20-0309-reasoning","grok-4-20-0309-reasoning"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"}},"required":["model","messages"],"title":"x-ai/grok-4-3, grok-4-3, x-ai/grok-4-20-0309-non-reasoning, grok-4-20-0309-non-reasoning, x-ai/grok-4-20-0309-reasoning, grok-4-20-0309-reasoning"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-4-5","grok-4-5","x-ai/grok-4-6","grok-4-6"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"}},"required":["model","messages"],"title":"x-ai/grok-4-5, grok-4-5, x-ai/grok-4-6, grok-4-6"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-4-7","grok-4-7"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"x-ai/grok-4-7, grok-4-7"},{"type":"object","properties":{"model":{"type":"string","enum":["xai/grok-build-0-1","x-ai/grok-build-0-1","grok-build-0-1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"xai/grok-build-0-1, x-ai/grok-build-0-1, grok-build-0-1"},{"type":"object","properties":{"model":{"type":"string","enum":["labs-leanstral-1-5","mistral/labs-leanstral-1-5","leanstral-1-5","mistral/leanstral-1-5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"labs-leanstral-1-5, mistral/labs-leanstral-1-5, leanstral-1-5, mistral/leanstral-1-5"},{"type":"object","properties":{"model":{"type":"string","enum":["mercury-3","inception/mercury-3","tencent/hy4-preview","hy4-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"mercury-3, inception/mercury-3, tencent/hy4-preview, hy4-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["ling-3.0-tiny","inclusionai/ling-3.0-tiny"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"ling-3.0-tiny, inclusionai/ling-3.0-tiny"},{"type":"object","properties":{"model":{"type":"string","enum":["motif-3","motif-technologies/motif-3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"motif-3, motif-technologies/motif-3"},{"type":"object","properties":{"model":{"type":"string","enum":["ternary-bonsai-2-9b","prism-ml/ternary-bonsai-2-9b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"reasoning_effort":{"type":"string","enum":["none"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"ternary-bonsai-2-9b, prism-ml/ternary-bonsai-2-9b"},{"type":"object","properties":{"model":{"type":"string","enum":["crouton-alpha","stealth/crouton-alpha"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"crouton-alpha, stealth/crouton-alpha"},{"type":"object","properties":{"model":{"type":"string","enum":["inkling-2-small","thinkingmachines/inkling-2-small"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"inkling-2-small, thinkingmachines/inkling-2-small"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3-235b-a22b-thinking-2507","qwen3-235b-a22b-thinking-2507"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3-235b-a22b-thinking-2507, qwen3-235b-a22b-thinking-2507"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3-32b","qwen3-32b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"enable_thinking":{"type":"boolean","default":false,"description":"Specifies whether to use the thinking mode."},"thinking_budget":{"type":"integer","minimum":1,"description":"The maximum reasoning length, effective only when enable_thinking is set to true."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3-32b, qwen3-32b"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3.8-2.4t-a95b","qwen3.8-2.4t-a95b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3.8-2.4t-a95b, qwen3.8-2.4t-a95b"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3.8-27b","qwen3.8-27b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3.8-27b, qwen3.8-27b"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3.8-max-prime","qwen3.8-max-prime"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3.8-max-prime, qwen3.8-max-prime"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3-coder-480b-a35b-instruct","qwen3-coder-480b-a35b-instruct"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3-coder-480b-a35b-instruct, qwen3-coder-480b-a35b-instruct"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen3-max-instruct","alibaba/qwen3-next-80b-a3b-instruct","qwen3-next-80b-a3b-instruct"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"alibaba/qwen3-max-instruct, alibaba/qwen3-next-80b-a3b-instruct, qwen3-next-80b-a3b-instruct"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen-plus","qwen-plus"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"enable_search":{"type":"boolean","default":false,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."}},"required":["model","messages"],"title":"alibaba/qwen-plus, qwen-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen-plus","qwen-plus","google/gemini-2.5-flash","gemini-2.5-flash","openai/gpt-3.5-turbo-16k","gpt-3.5-turbo-16k"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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"]}]},"minItems":1,"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."},"max_tokens":{"type":"number","nullable":true,"minimum":1,"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."},"max_completion_tokens":{"type":"integer","nullable":true,"minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"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."},"stream_options":{"type":"object","nullable":true,"properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"prediction":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","nullable":true,"minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_p":{"type":"number","nullable":true,"minimum":0.1,"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."},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"tools":{"type":"array","nullable":true,"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},{"nullable":true}],"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."},"parallel_tool_calls":{"type":"boolean","nullable":true,"description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","nullable":true,"enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."},{"nullable":true}],"description":"An object specifying the format that the model must output."},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"web_search_options":{"type":"object","nullable":true,"properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"enable_search":{"type":"boolean","nullable":true,"description":"Enable Alibaba Model Studio web search."},"search_options":{"type":"object","nullable":true,"properties":{"forced_search":{"type":"boolean"},"search_strategy":{"type":"string","enum":["turbo","max","agent"]},"enable_source":{"type":"boolean"}},"description":"Alibaba Model Studio web search options."}},"required":["model","messages"],"title":"alibaba/qwen-plus, qwen-plus, google/gemini-2.5-flash, gemini-2.5-flash, openai/gpt-3.5-turbo-16k, gpt-3.5-turbo-16k"},{"type":"object","properties":{"model":{"type":"string","enum":["anthracite-org/magnum-v4-72b","magnum-v4-72b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"anthracite-org/magnum-v4-72b, magnum-v4-72b"},{"type":"object","properties":{"model":{"type":"string","enum":["baidu/ernie-4.5-vl-424b-a47b","baidu/ernie-4-5-vl-424b-a47b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"baidu/ernie-4.5-vl-424b-a47b, baidu/ernie-4-5-vl-424b-a47b"},{"type":"object","properties":{"model":{"type":"string","enum":["baidu/ernie-4.5-vl-424b-a47b","baidu/ernie-4-5-vl-424b-a47b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"baidu/ernie-4.5-vl-424b-a47b, baidu/ernie-4-5-vl-424b-a47b"},{"type":"object","properties":{"model":{"type":"string","enum":["cohere/command-a","command-a"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"cohere/command-a, command-a"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-chat-v3-0324"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-chat-v3-0324"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-chat-v3.1","deepseek/deepseek-non-reasoner-v3.1-terminus","deepseek-non-reasoner-v3.1-terminus","deepseek/deepseek-non-thinking-v3.2-exp","deepseek-non-thinking-v3.2-exp","deepseek/deepseek-reasoner-v3.1-terminus","deepseek-reasoner-v3.1-terminus","deepseek/deepseek-thinking-v3.2-exp","deepseek-thinking-v3.2-exp-v2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-chat-v3.1, deepseek/deepseek-non-reasoner-v3.1-terminus, deepseek-non-reasoner-v3.1-terminus, deepseek/deepseek-non-thinking-v3.2-exp, deepseek-non-thinking-v3.2-exp, deepseek/deepseek-reasoner-v3.1-terminus, deepseek-reasoner-v3.1-terminus, deepseek/deepseek-thinking-v3.2-exp, deepseek-thinking-v3.2-exp-v2"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-r1","deepseek/deepseek-reasoner-v3.1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-r1, deepseek/deepseek-reasoner-v3.1"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4.1-flash","deepseek-flash","deepseek-v4.1-flash","deepseek/deepseek-flash","deepseek/deepseek-v4.1-flash-1017","deepseek/deepseek-v4-flash-vision-exp","deepseek-v4-flash-vision-exp"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"deepseek/deepseek-v4.1-flash, deepseek-flash, deepseek-v4.1-flash, deepseek/deepseek-flash, deepseek/deepseek-v4.1-flash-1017, deepseek/deepseek-v4-flash-vision-exp, deepseek-v4-flash-vision-exp"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4.1-flash","deepseek-flash","deepseek-v4.1-flash","deepseek/deepseek-flash","deepseek/deepseek-v4.1-flash-1017","deepseek/deepseek-v4-flash-vision-exp","deepseek-v4-flash-vision-exp"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-v4.1-flash, deepseek-flash, deepseek-v4.1-flash, deepseek/deepseek-flash, deepseek/deepseek-v4.1-flash-1017, deepseek/deepseek-v4-flash-vision-exp, deepseek-v4-flash-vision-exp"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4-flash","deepseek-v4-flash","deepseek/deepseek-v4-pro","deepseek-v4-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"}},"required":["model","messages"],"title":"deepseek/deepseek-v4-flash, deepseek-v4-flash, deepseek/deepseek-v4-pro, deepseek-v4-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4-flash","deepseek-v4-flash","deepseek/deepseek-v4-pro","deepseek-v4-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-v4-flash, deepseek-v4-flash, deepseek/deepseek-v4-pro, deepseek-v4-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4-pro","deepseek-v4-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."}},"required":["model","messages"],"title":"deepseek/deepseek-v4-pro, deepseek-v4-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["deepseek/deepseek-v4-pro-0813","deepseek-v4-pro-0813"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"deepseek/deepseek-v4-pro-0813, deepseek-v4-pro-0813"},{"type":"object","properties":{"model":{"type":"string","enum":["elorian/glimpse","glimpse"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"elorian/glimpse, glimpse"},{"type":"object","properties":{"model":{"type":"string","enum":["fireworks/ember-1","ember-1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["low","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"fireworks/ember-1, ember-1"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-2.5-flash","gemini-2.5-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."}},"required":["model","messages"],"title":"google/gemini-2.5-flash, gemini-2.5-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-2.5-flash-lite","gemini-2.5-flash-lite","google/gemini-2.5-flash-lite-preview","gemini-2.5-flash-lite-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"google/gemini-2.5-flash-lite, gemini-2.5-flash-lite, google/gemini-2.5-flash-lite-preview, gemini-2.5-flash-lite-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-2.5-pro","gemini-2.5-pro","google/gemini-3.1-pro-preview","gemini-3-1-pro-preview","gemini-3.1-pro-preview","google/gemini-3-1-pro-preview","google/gemini-3-flash-preview","gemini-3-flash-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."}},"required":["model","messages"],"title":"google/gemini-2.5-pro, gemini-2.5-pro, google/gemini-3.1-pro-preview, gemini-3-1-pro-preview, gemini-3.1-pro-preview, google/gemini-3-1-pro-preview, google/gemini-3-flash-preview, gemini-3-flash-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-2.5-pro","gemini-2.5-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemini-2.5-pro, gemini-2.5-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-1-flash-lite","google/gemini-3.1-flash-lite","gemini-3.1-flash-lite","google/gemini-3-5-flash","gemini-3-5-flash","google/gemini-3.5-flash","gemini-3.5-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"google/gemini-3-1-flash-lite, google/gemini-3.1-flash-lite, gemini-3.1-flash-lite, google/gemini-3-5-flash, gemini-3-5-flash, google/gemini-3.5-flash, gemini-3.5-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3.1-pro-preview","gemini-3-1-pro-preview","gemini-3.1-pro-preview","google/gemini-3-1-pro-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemini-3.1-pro-preview, gemini-3-1-pro-preview, gemini-3.1-pro-preview, google/gemini-3-1-pro-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-5-flash-lite","gemini-3-5-flash-lite","google/gemini-3.5-flash-lite","gemini-3.5-flash-lite"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"google/gemini-3-5-flash-lite, gemini-3-5-flash-lite, google/gemini-3.5-flash-lite, gemini-3.5-flash-lite"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-6-flash","gemini-3-6-flash","google/gemini-3.6-flash","gemini-3.6-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"google/gemini-3-6-flash, gemini-3-6-flash, google/gemini-3.6-flash, gemini-3.6-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-7-flash","gemini-3-7-flash","google/gemini-3.7-flash","gemini-3.7-flash","google/gemini-3-8-flash","gemini-3-8-flash","google/gemini-3.8-flash","gemini-3.8-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"google/gemini-3-7-flash, gemini-3-7-flash, google/gemini-3.7-flash, gemini-3.7-flash, google/gemini-3-8-flash, gemini-3-8-flash, google/gemini-3.8-flash, gemini-3.8-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-flash-preview","gemini-3-flash-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemini-3-flash-preview, gemini-3-flash-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-4-carbon","gemini-4-carbon"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemini-4-carbon, gemini-4-carbon"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemma-3-12b-it","gemma-3-12b-it"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemma-3-12b-it, gemma-3-12b-it"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemma-3-27b-it","gemma-3-27b-it"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemma-3-27b-it, gemma-3-27b-it"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemma-3-4b-it","gemma-3-4b-it"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemma-3-4b-it, gemma-3-4b-it"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemma-4-26b-a4b-it","gemma-4-26b-a4b-it","google/gemma-4-31b-it","gemma-4-31b-it"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"google/gemma-4-26b-a4b-it, gemma-4-26b-a4b-it, google/gemma-4-31b-it, gemma-4-31b-it"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemma-4-26b-a4b-it","gemma-4-26b-a4b-it","google/gemma-4-26b-a4b-it-maas","gemma-4-26b-a4b-it-maas"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."}},"required":["model","messages"],"title":"google/gemma-4-26b-a4b-it, gemma-4-26b-a4b-it, google/gemma-4-26b-a4b-it-maas, gemma-4-26b-a4b-it-maas"},{"type":"object","properties":{"model":{"type":"string","enum":["gryphe/mythomax-l2-13b","mythomax-l2-13b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":["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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"gryphe/mythomax-l2-13b, mythomax-l2-13b"},{"type":"object","properties":{"model":{"type":"string","enum":["ibm-granite/granite-4.2-8b","granite-4.2-8b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"ibm-granite/granite-4.2-8b, granite-4.2-8b"},{"type":"object","properties":{"model":{"type":"string","enum":["inclusionai/ling-3.0-flash","inclusionai/ling-3.0-flash:free","ling-3.0-flash","ling-3.0-flash:free","inclusionai/ling-3.1-flash","ling-3.1-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"inclusionai/ling-3.0-flash, inclusionai/ling-3.0-flash:free, ling-3.0-flash, ling-3.0-flash:free, inclusionai/ling-3.1-flash, ling-3.1-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["inclusionai/ling-3.0-flash-vl","inclusionai/ling-3.0-flash-vl:free","ling-3.0-flash-vl","ling-3.0-flash-vl:free"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"inclusionai/ling-3.0-flash-vl, inclusionai/ling-3.0-flash-vl:free, ling-3.0-flash-vl, ling-3.0-flash-vl:free"},{"type":"object","properties":{"model":{"type":"string","enum":["inference-net/schematron-v2-small","schematron-v2-small","inference-net/schematron-v2-turbo","schematron-v2-turbo"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"inference-net/schematron-v2-small, schematron-v2-small, inference-net/schematron-v2-turbo, schematron-v2-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/lfm-2.5-24b-a2b","lfm-2.5-24b-a2b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"liquid/lfm-2.5-24b-a2b, lfm-2.5-24b-a2b"},{"type":"object","properties":{"model":{"type":"string","enum":["meta-llama/Llama-3.3-70B-Instruct-Turbo"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"meta-llama/Llama-3.3-70B-Instruct-Turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["meta/muse-glimmer-30b","muse-glimmer-30b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"meta/muse-glimmer-30b, muse-glimmer-30b"},{"type":"object","properties":{"model":{"type":"string","enum":["meta/muse-spark-open","muse-spark-open"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"meta/muse-spark-open, muse-spark-open"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/m1","minimax-m1"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"minimax/m1, minimax-m1"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/minimax-m3.1-flash","minimax-m3.1-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"minimax/minimax-m3.1-flash, minimax-m3.1-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/minimax-m3.1-flash","minimax-m3.1-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"minimax/minimax-m3.1-flash, minimax-m3.1-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/MiniMax-Text-01","minimax-text-01"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":1,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"mask_sensitive_info":{"type":"boolean","default":false,"description":"Mask (replace with ***) content in the output that involves private information, including but not limited to email, domain, link, ID number, home address, etc. Defaults to False, i.e. enable masking."}},"required":["model","messages"],"title":"minimax/MiniMax-Text-01, minimax-text-01"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/MiniMax-Text-01","minimax-text-01"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"minimax/MiniMax-Text-01, minimax-text-01"},{"type":"object","properties":{"model":{"type":"string","enum":["mistralai/devstral-2512","devstral-2512"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"mistralai/devstral-2512, devstral-2512"},{"type":"object","properties":{"model":{"type":"string","enum":["mistralai/mistral-large-4-0","mistral-large-4-0","mistral/mistral-large-4-0"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"mistralai/mistral-large-4-0, mistral-large-4-0, mistral/mistral-large-4-0"},{"type":"object","properties":{"model":{"type":"string","enum":["mistralai/mistral-large-4-0","mistral-large-4-0","mistral/mistral-large-4-0"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"mistralai/mistral-large-4-0, mistral-large-4-0, mistral/mistral-large-4-0"},{"type":"object","properties":{"model":{"type":"string","enum":["mistralai/mistral-nemo","mistral-nemo"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"mistralai/mistral-nemo, mistral-nemo"},{"type":"object","properties":{"model":{"type":"string","enum":["moondream/moondream3.1-9b-a2b","moondream3.1-9b-a2b","moondream/moondream3-preview","moondream3-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"moondream/moondream3.1-9b-a2b, moondream3.1-9b-a2b, moondream/moondream3-preview, moondream3-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k3","kimi-k3","moonshotai/kimi-k3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["function","builtin_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":{"anyOf":[{"type":"string","enum":["$web_search"]},{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."},"required":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}]},"description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"moonshot/kimi-k3, kimi-k3, moonshotai/kimi-k3"},{"type":"object","properties":{"model":{"type":"string","enum":["moonshot/kimi-k3","kimi-k3","moonshotai/kimi-k3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["low","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"moonshot/kimi-k3, kimi-k3, moonshotai/kimi-k3"},{"type":"object","properties":{"model":{"type":"string","enum":["nousresearch/hermes-4-405b","hermes-4-405b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"nousresearch/hermes-4-405b, hermes-4-405b"},{"type":"object","properties":{"model":{"type":"string","enum":["nvidia/nemotron-3.5-content-safety","nemotron-3.5-content-safety"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"nvidia/nemotron-3.5-content-safety, nemotron-3.5-content-safety"},{"type":"object","properties":{"model":{"type":"string","enum":["nvidia/nemotron-3.5-lightning","nemotron-3.5-lightning","nemotron-3.5-lightning:free","nvidia/nemotron-3.5-lightning:free","nvidia/nemotron-3-nano-30b-a3b","nemotron-3-nano-30b-a3b","nvidia/nemotron-3-super-120b-a12b","nemotron-3-super-120b-a12b","nvidia/nemotron-3-ultra-550b-a55b","nemotron-3-ultra-550b-a55b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"nvidia/nemotron-3.5-lightning, nemotron-3.5-lightning, nemotron-3.5-lightning:free, nvidia/nemotron-3.5-lightning:free, nvidia/nemotron-3-nano-30b-a3b, nemotron-3-nano-30b-a3b, nvidia/nemotron-3-super-120b-a12b, nemotron-3-super-120b-a12b, nvidia/nemotron-3-ultra-550b-a55b, nemotron-3-ultra-550b-a55b"},{"type":"object","properties":{"model":{"type":"string","enum":["nvidia/nemotron-3.5-super-vl","nemotron-3.5-super-vl"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"nvidia/nemotron-3.5-super-vl, nemotron-3.5-super-vl"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-3.5-turbo-0613","gpt-3.5-turbo-0613"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-3.5-turbo-0613, gpt-3.5-turbo-0613"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-4.1","gpt-4.1","openai/gpt-4.1-2025-04-14","gpt-4.1-2025-04-14","openai/gpt-4.1-mini","gpt-4.1-mini","openai/gpt-4.1-mini-2025-04-14","gpt-4.1-mini-2025-04-14","openai/gpt-4o","gpt-4o","openai/gpt-4o-2024-08-06","gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","gpt-4o-2024-11-20","openai/gpt-4o-mini","gpt-4o-mini","openai/gpt-4o-mini-2024-07-18","gpt-4o-mini-2024-07-18"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."}},"required":["model","messages"],"title":"openai/gpt-4.1, gpt-4.1, openai/gpt-4.1-2025-04-14, gpt-4.1-2025-04-14, openai/gpt-4.1-mini, gpt-4.1-mini, openai/gpt-4.1-mini-2025-04-14, gpt-4.1-mini-2025-04-14, openai/gpt-4o, gpt-4o, openai/gpt-4o-2024-08-06, gpt-4o-2024-08-06, openai/gpt-4o-2024-11-20, gpt-4o-2024-11-20, openai/gpt-4o-mini, gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, gpt-4o-mini-2024-07-18"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-4.1","gpt-4.1","openai/gpt-4.1-2025-04-14","gpt-4.1-2025-04-14","openai/gpt-4o","gpt-4o","openai/gpt-4o-2024-05-13","gpt-4o-2024-05-13","openai/gpt-4o-2024-08-06","gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","gpt-4o-2024-11-20","openai/gpt-4o-mini","gpt-4o-mini","openai/gpt-4o-mini-2024-07-18","gpt-4o-mini-2024-07-18"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-4.1, gpt-4.1, openai/gpt-4.1-2025-04-14, gpt-4.1-2025-04-14, openai/gpt-4o, gpt-4o, openai/gpt-4o-2024-05-13, gpt-4o-2024-05-13, openai/gpt-4o-2024-08-06, gpt-4o-2024-08-06, openai/gpt-4o-2024-11-20, gpt-4o-2024-11-20, openai/gpt-4o-mini, gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, gpt-4o-mini-2024-07-18"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5","gpt-5","openai/gpt-5-2025-08-07","gpt-5-2025-08-07","openai/gpt-5-mini","gpt-5-mini","openai/gpt-5-mini-2025-08-07","gpt-5-mini-2025-08-07","openai/gpt-5-nano","gpt-5-nano","openai/gpt-5-nano-2025-08-07","gpt-5-nano-2025-08-07"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. Only the provider default value is supported for this model."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"openai/gpt-5, gpt-5, openai/gpt-5-2025-08-07, gpt-5-2025-08-07, openai/gpt-5-mini, gpt-5-mini, openai/gpt-5-mini-2025-08-07, gpt-5-mini-2025-08-07, openai/gpt-5-nano, gpt-5-nano, openai/gpt-5-nano-2025-08-07, gpt-5-nano-2025-08-07"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5","gpt-5","openai/gpt-5-mini","gpt-5-mini","openai/gpt-5-nano","gpt-5-nano"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-5, gpt-5, openai/gpt-5-mini, gpt-5-mini, openai/gpt-5-nano, gpt-5-nano"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5-1","openai/gpt-5.1-2025-11-13","gpt-5.1-2025-11-13"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"openai/gpt-5-1, openai/gpt-5.1-2025-11-13, gpt-5.1-2025-11-13"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5-2","openai/gpt-5.2-2025-12-11","gpt-5.2-2025-12-11"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"openai/gpt-5-2, openai/gpt-5.2-2025-12-11, gpt-5.2-2025-12-11"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5.6-luna","gpt-5.6-luna","openai/gpt-5.6-luna-pro","gpt-5.6-luna-pro","openai/gpt-5.6-sol","gpt-5.6-sol","openai/gpt-5.6-sol-pro","gpt-5.6-sol-pro","openai/gpt-5.6-terra","gpt-5.6-terra","openai/gpt-5.6-terra-pro","gpt-5.6-terra-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-5.6-luna, gpt-5.6-luna, openai/gpt-5.6-luna-pro, gpt-5.6-luna-pro, openai/gpt-5.6-sol, gpt-5.6-sol, openai/gpt-5.6-sol-pro, gpt-5.6-sol-pro, openai/gpt-5.6-terra, gpt-5.6-terra, openai/gpt-5.6-terra-pro, gpt-5.6-terra-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-6-astra","gpt-6-astra"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"openai/gpt-6-astra, gpt-6-astra"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-6-astra","gpt-6-astra"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-6-astra, gpt-6-astra"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-audio","gpt-audio","openai/gpt-audio-2025-08-28","gpt-audio-2025-08-28","openai/gpt-audio-mini","gpt-audio-mini","openai/gpt-audio-mini-2025-10-06","gpt-audio-mini-2025-10-06"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"}},"required":["model","messages"],"title":"openai/gpt-audio, gpt-audio, openai/gpt-audio-2025-08-28, gpt-audio-2025-08-28, openai/gpt-audio-mini, gpt-audio-mini, openai/gpt-audio-mini-2025-10-06, gpt-audio-mini-2025-10-06"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-oss-120b","gpt-oss-120b","openai/gpt-oss-20b","gpt-oss-20b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"openai/gpt-oss-120b, gpt-oss-120b, openai/gpt-oss-20b, gpt-oss-20b"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-oss-120b","gpt-oss-120b","openai/gpt-oss-20b","gpt-oss-20b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."}},"required":["model","messages"],"title":"openai/gpt-oss-120b, gpt-oss-120b, openai/gpt-oss-20b, gpt-oss-20b"},{"type":"object","properties":{"model":{"type":"string","enum":["openai/o3-2025-04-16","o3-2025-04-16"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"openai/o3-2025-04-16, o3-2025-04-16"},{"type":"object","properties":{"model":{"type":"string","enum":["perceptron/perceptron-mk1.5","perceptron-mk1.5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"perceptron/perceptron-mk1.5, perceptron-mk1.5"},{"type":"object","properties":{"model":{"type":"string","enum":["prism-ml/ternary-bonsai-2-27b","ternary-bonsai-2-27b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"prism-ml/ternary-bonsai-2-27b, ternary-bonsai-2-27b"},{"type":"object","properties":{"model":{"type":"string","enum":["reflection/beam-1.0-501b-a23b","beam-1.0-501b-a23b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"reflection/beam-1.0-501b-a23b, beam-1.0-501b-a23b"},{"type":"object","properties":{"model":{"type":"string","enum":["sakana/fugu-max","fugu-max","sakana/fugu-ultra-v2","fugu-ultra-v2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"sakana/fugu-max, fugu-max, sakana/fugu-ultra-v2, fugu-ultra-v2"},{"type":"object","properties":{"model":{"type":"string","enum":["sakana/fugu-ultra","fugu-ultra"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"sakana/fugu-ultra, fugu-ultra"},{"type":"object","properties":{"model":{"type":"string","enum":["sakana/sakana-namazu","sakana-namazu"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"sakana/sakana-namazu, sakana-namazu"},{"type":"object","properties":{"model":{"type":"string","enum":["scaledown/summarize","summarize"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"scaledown/summarize, summarize"},{"type":"object","properties":{"model":{"type":"string","enum":["stealth/space-bunny-alpha","space-bunny-alpha"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"stealth/space-bunny-alpha, space-bunny-alpha"},{"type":"object","properties":{"model":{"type":"string","enum":["stepfun/step-3.7-flash","step-3.7-flash"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"stepfun/step-3.7-flash, step-3.7-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["stepfun/step-5-preview","step-5-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"stepfun/step-5-preview, step-5-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["tencent/hy4","hy4"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["none","low","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."}},"required":["model","messages"],"title":"tencent/hy4, hy4"},{"type":"object","properties":{"model":{"type":"string","enum":["tencent/hy4","hy4"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"reasoning_effort":{"type":"string","enum":["none","low","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"tencent/hy4, hy4"},{"type":"object","properties":{"model":{"type":"string","enum":["tencent/hy-mt2-1.8b","hy-mt2-1.8b","tencent/hy-mt2-7b","hy-mt2-7b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"tencent/hy-mt2-1.8b, hy-mt2-1.8b, tencent/hy-mt2-7b, hy-mt2-7b"},{"type":"object","properties":{"model":{"type":"string","enum":["tencent/hy-mt2-30b-a3b","hy-mt2-30b-a3b"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"tencent/hy-mt2-30b-a3b, hy-mt2-30b-a3b"},{"type":"object","properties":{"model":{"type":"string","enum":["thinkingmachines/inkling","inkling"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"thinkingmachines/inkling, inkling"},{"type":"object","properties":{"model":{"type":"string","enum":["thinkingmachines/inkling-small","inkling-small"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"thinkingmachines/inkling-small, inkling-small"},{"type":"object","properties":{"model":{"type":"string","enum":["unbiased/pareto","pareto"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"unbiased/pareto, pareto"},{"type":"object","properties":{"model":{"type":"string","enum":["unbiased/pareto-26.10","pareto-26.10","unbiased/pareto-26.10-preview","pareto-26.10-preview"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"unbiased/pareto-26.10, pareto-26.10, unbiased/pareto-26.10-preview, pareto-26.10-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["upstage/solar-mini4","solar-mini4"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"upstage/solar-mini4, solar-mini4"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-4-20-0309-non-reasoning","grok-4-20-0309-non-reasoning","x-ai/grok-4-20-0309-reasoning","grok-4-20-0309-reasoning"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"x-ai/grok-4-20-0309-non-reasoning, grok-4-20-0309-non-reasoning, x-ai/grok-4-20-0309-reasoning, grok-4-20-0309-reasoning"},{"type":"object","properties":{"model":{"type":"string","enum":["xiaomi/mimo-v2.5","mimo-v2.5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"xiaomi/mimo-v2.5, mimo-v2.5"},{"type":"object","properties":{"model":{"type":"string","enum":["xiaomi/mimo-v2.5-pro","mimo-v2.5-pro"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"xiaomi/mimo-v2.5-pro, mimo-v2.5-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["xiaomi/mimo-v2.6-flash","mimo-v2.6-flash","xiaomi/mimo-v2.6-pro","mimo-v2.6-pro","xiaomi/mimo-v2.6-pro-ultraspeed","mimo-v2.6-pro-ultraspeed"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"xiaomi/mimo-v2.6-flash, mimo-v2.6-flash, xiaomi/mimo-v2.6-pro, mimo-v2.6-pro, xiaomi/mimo-v2.6-pro-ultraspeed, mimo-v2.6-pro-ultraspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["z-ai/glm-4.5","z-ai/glm-4.5-air","z-ai/glm-4.5v","glm-4.5v","z-ai/glm-4.6","z-ai/glm-4.6v","glm-4.6v","z-ai/glm-4.7","z-ai/glm-4.7-flash","glm-4.7-flash","z-ai/glm-5","z-ai/glm-5.1","z-ai/glm-5.2","z-ai/glm-5-turbo","glm-5-turbo","z-ai/glm-5v-turbo","glm-5v-turbo","zhipu/glm-4.5","glm-4.5","zhipu/glm-4.5-air","glm-4.5-air","zhipu/glm-4.6","glm-4.6","zhipu/glm-4.7","glm-4.7","zhipu/glm-5","glm-5","zhipu/glm-5-1","zhipu/glm-5.1","glm-5.1","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"z-ai/glm-4.5, z-ai/glm-4.5-air, z-ai/glm-4.5v, glm-4.5v, z-ai/glm-4.6, z-ai/glm-4.6v, glm-4.6v, z-ai/glm-4.7, z-ai/glm-4.7-flash, glm-4.7-flash, z-ai/glm-5, z-ai/glm-5.1, z-ai/glm-5.2, z-ai/glm-5-turbo, glm-5-turbo, z-ai/glm-5v-turbo, glm-5v-turbo, zhipu/glm-4.5, glm-4.5, zhipu/glm-4.5-air, glm-4.5-air, zhipu/glm-4.6, glm-4.6, zhipu/glm-4.7, glm-4.7, zhipu/glm-5, glm-5, zhipu/glm-5-1, zhipu/glm-5.1, glm-5.1, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2"},{"type":"object","properties":{"model":{"type":"string","enum":["z-ai/glm-5.3","z-ai/glm-5.3-flash","glm-5.3-flash","ox-alpha","stealth/ox-alpha","zhipu/glm-5.3-flash","z-ai/glm-5.3-flashx","glm-5.3-flashx","zhipu/glm-5.3-flashx","zhipu/glm-5-3","zhipu/glm-5.3","glm-5.3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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":{"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":"An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","minimum":-100,"maximum":100},"description":"Modify the likelihood of specified tokens appearing in the completion.\n  \n  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"],"description":"High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default."},"user_location":{"type":"object","nullable":true,"properties":{"approximate":{"type":"object","properties":{"city":{"type":"string","description":"Free text input for the city of the user, e.g. San Francisco."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The two-letter ISO country code of the user, e.g. US."},"region":{"type":"string","description":"Free text input for the region of the user, e.g. California."},"timezone":{"type":"string","description":"The IANA timezone of the user, e.g. America/Los_Angeles."}},"description":"Approximate location parameters for the search."},"type":{"type":"string","enum":["approximate"],"description":"The type of location approximation. Always approximate."}},"required":["approximate","type"],"description":"Approximate location parameters for the search."}},"description":"This tool searches the web for relevant results to use in a response."},"search_mode":{"type":"string","enum":["academic","web"],"default":"academic","description":"Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources like peer-reviewed papers and academic journals."},"search_domain_filter":{"type":"array","items":{"type":"string"},"description":"A list of domains to limit search results to. Currently limited to 10 domains for Allowlisting and Denylisting. For Denylisting, add a - at the beginning of the domain string."},"return_images":{"type":"boolean","default":false,"description":"Determines whether search results should include images."},"return_related_questions":{"type":"boolean","default":false,"description":"Determines whether related questions should be returned."},"search_recency_filter":{"type":"string","enum":["day","week","month","year"],"description":"Filters search results based on time (e.g., 'week', 'day')."},"search_after_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"search_before_date_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content published before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_after_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated after this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"last_updated_before_filter":{"type":"string","pattern":"^(0?[1-9]|1[0-2])\\/(0?[1-9]|[12]\\d|3[01])\\/\\d{4}$","description":"Filters search results to only include content last updated before this date. Format should be %m/%d/%Y (e.g. 3/1/2025)"},"echo":{"type":"boolean","description":"If True, the response will contain the prompt. Can be used with logprobs to return prompt logprobs."},"min_p":{"type":"number","minimum":0.001,"maximum":0.999,"description":"A number between 0.001 and 0.999 that can be used as an alternative to top_p and top_k."},"top_k":{"type":"number","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."},"repetition_penalty":{"type":"number","nullable":true,"description":"A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition."},"top_a":{"type":"number","minimum":0,"maximum":1,"description":"Alternate top sampling parameter."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled"],"default":"enabled","description":"Whether to enable the chain of thought. This model always reasons, so `enabled` is the only accepted value."}},"description":"Control whether the model enables chain of thought. This model cannot disable it — use `reasoning_effort` to control the depth instead."},"provider_options":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to try first, in this order, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"only":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to allow — every other upstream is excluded, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"ignore":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":32,"description":"Upstream provider slugs of the opentree provider to skip, e.g. [\"deepinfra/bf16\", \"together\"]. A bare slug matches every variant of that provider."},"allow_fallbacks":{"type":"boolean","description":"Whether the opentree provider may fall back to an upstream outside `order`/`only` when the preferred ones are unavailable. Default true; set false to fail instead."},"require_parameters":{"type":"boolean","description":"Only route to upstreams that support every parameter in this request. Default false."},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"minItems":1,"description":"Only route to upstreams serving one of these quantizations."},"sort":{"type":"string","enum":["price","throughput","latency"],"description":"Upstream ordering when `order` is not set. The opentree provider defaults to a price/uptime blend."},"data_collection":{"type":"string","enum":["allow","deny"],"description":"`deny` excludes upstreams that may store or train on prompts."},"zdr":{"type":"boolean","description":"Only route to Zero Data Retention upstreams."}},"additionalProperties":false,"description":"Upstream routing for the opentree provider. Applies only when the request is served through the opentree provider (pin `provider: \"opentree\"` to be sure); every other provider refuses it rather than ignore it."}},"required":["model","messages"],"title":"z-ai/glm-5.3, z-ai/glm-5.3-flash, glm-5.3-flash, ox-alpha, stealth/ox-alpha, zhipu/glm-5.3-flash, z-ai/glm-5.3-flashx, glm-5.3-flashx, zhipu/glm-5.3-flashx, zhipu/glm-5-3, zhipu/glm-5.3, glm-5.3"},{"type":"object","properties":{"model":{"type":"string","enum":["z-ai/glm-5.3-flash","glm-5.3-flash","ox-alpha","stealth/ox-alpha","zhipu/glm-5.3-flash","z-ai/glm-5.3-flashx","glm-5.3-flashx","zhipu/glm-5.3-flashx"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled"],"default":"enabled","description":"Whether to enable the chain of thought. This model always reasons, so `enabled` is the only accepted value."}},"description":"Control whether the model enables chain of thought. This model cannot disable it — use `reasoning_effort` to control the depth instead."},"reasoning_effort":{"type":"string","enum":["low","high","max"],"description":"Depth of the reasoning phase. Higher levels spend more reasoning tokens, which are billed as output. This model always reasons, so there is no level that turns it off."}},"required":["model","messages"],"title":"z-ai/glm-5.3-flash, glm-5.3-flash, ox-alpha, stealth/ox-alpha, zhipu/glm-5.3-flash, z-ai/glm-5.3-flashx, glm-5.3-flashx, zhipu/glm-5.3-flashx"},{"type":"object","properties":{"model":{"type":"string","enum":["z-ai/glm-5-turbo","glm-5-turbo","zhipu/glm-5","glm-5","zhipu/glm-5-1","zhipu/glm-5.1","glm-5.1","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled","disabled"],"default":"enabled","description":"Whether to enable the chain of thought"}},"description":"Control whether the model enables chain of thought. Only supported by GLM-4.5 and above models."}},"required":["model","messages"],"title":"z-ai/glm-5-turbo, glm-5-turbo, zhipu/glm-5, glm-5, zhipu/glm-5-1, zhipu/glm-5.1, glm-5.1, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2"},{"type":"object","properties":{"model":{"type":"string","enum":["z-ai/glm-5v-turbo","glm-5v-turbo"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled","disabled"],"default":"enabled","description":"Whether to enable the chain of thought"}},"description":"Control whether the model enables chain of thought. Only supported by GLM-4.5 and above models."}},"required":["model","messages"],"title":"z-ai/glm-5v-turbo, glm-5v-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["zhipu/glm-4.5","glm-4.5","zhipu/glm-4.5-air","glm-4.5-air"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"anyOf":[{"type":"string","enum":["search_pro_jina"]},{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."},"required":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"],"description":"Web search tool for real-time information retrieval"},"web_search":{"type":"object","properties":{"search_engine":{"type":"string","enum":["search_pro_jina"],"description":"Search engine to use"},"enable":{"type":"boolean","description":"Whether to enable web search"},"search_query":{"type":"string","description":"Search query string"},"count":{"type":"integer","minimum":1,"maximum":20,"description":"Number of search results to return"},"search_result":{"type":"boolean","default":true,"description":"Whether to include search results in response"},"require_search":{"type":"boolean","default":true,"description":"Whether search is required"}},"required":["search_engine","enable"]}},"required":["type","web_search"]}]},{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}],"description":"Tool definition for zhipu models supporting both function calling and web search"},"description":"Tools for zhipu models supporting both function calling and web search"},"tool_choice":{"anyOf":[{"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."}],"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled","disabled"],"default":"enabled","description":"Whether to enable the chain of thought"}},"description":"Control whether the model enables chain of thought. Only supported by GLM-4.5 and above models."}},"required":["model","messages"],"title":"zhipu/glm-4.5, glm-4.5, zhipu/glm-4.5-air, glm-4.5-air"},{"type":"object","properties":{"model":{"type":"string","enum":["zhipu/glm-4.6","glm-4.6","zhipu/glm-4.7","glm-4.7","zhipu/glm-5","glm-5"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"zhipu/glm-4.6, glm-4.6, zhipu/glm-4.7, glm-4.7, zhipu/glm-5, glm-5"},{"type":"object","properties":{"model":{"type":"string","enum":["zhipu/glm-5-1","zhipu/glm-5.1","glm-5.1","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."}},"required":["model","messages"],"title":"zhipu/glm-5-1, zhipu/glm-5.1, glm-5.1, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2"},{"type":"object","properties":{"model":{"type":"string","enum":["zhipu/glm-5-3","zhipu/glm-5.3","glm-5.3"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":{"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 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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"thinking":{"type":"object","properties":{"type":{"type":"string","enum":["enabled"],"default":"enabled","description":"Whether to enable the chain of thought. This model always reasons, so `enabled` is the only accepted value."}},"description":"Control whether the model enables chain of thought. This model cannot disable it — use `reasoning_effort` to control the depth instead."}},"required":["model","messages"],"title":"zhipu/glm-5-3, zhipu/glm-5.3, glm-5.3"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"reasoning_content":{"type":"string","description":"The reasoning this model returned with this turn, handed back unchanged. Thinking models that ask for it (DeepSeek, Kimi, GLM, Qwen, and OpenRouter models whose reasoning is mandatory) refuse a tool-result turn without it."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"logprobs":{"type":"boolean","nullable":true,"description":"Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message."},"top_logprobs":{"type":"number","nullable":true,"minimum":0,"maximum":20,"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"reasoning_effort":{"type":"string","enum":["none","low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["low","medium","high"],"description":"Reasoning effort setting"},"max_tokens":{"type":"integer","minimum":1,"description":"Max tokens of reasoning content. Cannot be used simultaneously with effort."},"exclude":{"type":"boolean","description":"Whether to exclude reasoning from the response"}},"description":"Configuration for model reasoning/thinking tokens"},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"frequency_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"presence_penalty":{"type":"number","nullable":true,"minimum":-2,"maximum":2,"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]},{"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":["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"]}]}}],"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":["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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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."}},"required":["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."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"audio":{"type":"object","nullable":true,"properties":{"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"],"description":"Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer"]},{"type":"string"}],"description":"The voice the model uses to respond. Supported voices are alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, and shimmer."}},"required":["format","voice"],"description":"Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]."},"modalities":{"type":"array","nullable":true,"items":{"type":"string","enum":["text","audio"]},"description":"Output types that you would like the model to generate. Most models are capable of generating text, which is the default:\n  \n  [\"text\"]\n  \n  Model can also be used to generate audio. To request that this model generate both text and audio responses, you can use:\n  \n  [\"text\", \"audio\"]"},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both."},"top_p":{"type":"number","minimum":0.01,"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."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"nullable":true}],"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."},"prediction":{"type":"object","properties":{"type":{"type":"string","enum":["content"],"description":"The type of the predicted content you want to provide."},"content":{"anyOf":[{"type":"string","description":"The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes."},{"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."}},"required":["type","text"]},"description":"An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs."}],"description":"The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly."}},"required":["type","content"],"description":"Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"reasoning_effort":{"type":"string","enum":["minimal","low","medium","high","max"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. Use a source key such as `openai`, `opentree`, `xai`, `google`, `alibaba`, `minimax`, `moonshot`, `baidu`, or `togetherai` to run that provider with no fallback; `auto` (default) uses the full fallback chain. Case-insensitive.","example":"auto"},"messages":{"type":"array","items":{"oneOf":[{"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":["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_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":["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"]}]}}],"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":{"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"]},{"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":["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","nullable":true,"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":["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."},{"nullable":true}],"description":"The contents of the Assistant message. Required unless tool_calls or function_call is specified."},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role."},"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":{"nullable":true},"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":{"nullable":true},"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."},"refusal":{"type":"string","nullable":true,"description":"The refusal message by the Assistant."}},"required":["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."},"max_tokens":{"type":"number","minimum":1,"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."},"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."},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"required":["include_usage"]},"tools":{"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported."},"tool_choice":{"anyOf":[{"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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."},"normalize_tool_schemas":{"type":"boolean","description":"Enable provider compatibility normalization for tool function JSON schemas."},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use."},"n":{"type":"integer","nullable":true,"minimum":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs."},"seed":{"type":"integer","minimum":1,"description":"This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"response_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"The type of response format being defined. Always text."}},"required":["type"],"additionalProperties":false,"description":"Default response format. Used to generate text responses."},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"description":"The type of response format being defined. Always json_object."}},"required":["type"],"additionalProperties":false,"description":"An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so."},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"description":"The type of response format being defined. Always json_schema."},"json_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"schema":{"type":"object","additionalProperties":{"nullable":true},"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","nullable":true,"description":"Whether to enable strict schema adherence when generating the output. If set to True, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is True."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."}},"required":["name"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}},"required":["type","json_schema"],"additionalProperties":false,"description":"JSON Schema response format. Used to generate structured JSON responses."}],"description":"An object specifying the format that the model must output."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A unique identifier for the chat completion.","example":"chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl"},"object":{"type":"string","enum":["chat.completion"],"description":"The object type.","example":"chat.completion"},"created":{"type":"number","description":"The Unix timestamp (in seconds) of when the chat completion was created.","example":1762343744},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number","description":"The index of the choice in the list of choices.","example":0},"message":{"type":"object","properties":{"role":{"type":"string","description":"The role of the author of this message.","example":"assistant"},"content":{"type":"string","description":"The contents of the message.","example":"Hello! I'm just a program, so I don't have feelings, but I'm here and ready to help you. How can I assist you today?"},"refusal":{"type":"string","nullable":true,"description":"The refusal message generated by the model.","example":null},"annotations":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string","enum":["url_citation"],"description":"The type of the URL citation. Always url_citation."},"url_citation":{"type":"object","properties":{"end_index":{"type":"integer","description":"The index of the last character of the URL citation in the message."},"start_index":{"type":"integer","description":"The index of the first character of the URL citation in the message."},"title":{"type":"string","description":"The title of the web resource."},"url":{"type":"string","description":"The URL of the web resource."}},"required":["end_index","start_index","title","url"],"description":"A URL citation when using web search."}},"required":["type","url_citation"]},"description":"Annotations for the message, when applicable, as when using the web search tool.","example":null},"audio":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"Unique identifier for this audio response."},"data":{"type":"string","description":"Base64 encoded audio bytes generated by the model, in the format specified in the request."},"transcript":{"type":"string","description":"Transcript of the audio generated by the model."},"expires_at":{"type":"integer","description":"The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations."}},"required":["id","data","transcript","expires_at"],"description":"A chat completion message generated by the model.","example":null},"tool_calls":{"type":"array","nullable":true,"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."},"function":{"type":"object","properties":{"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."},"name":{"type":"string","description":"The name of the function to call."}},"required":["arguments","name"],"description":"The function that the model called."}},"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."},"custom":{"type":"object","properties":{"input":{"type":"string","description":"The input for the custom tool call generated by the model."},"name":{"type":"string","description":"The name of the custom tool to call."}},"required":["input","name"],"description":"The custom tool that the model called."}},"required":["id","type","custom"]}]},"description":"The tool calls generated by the model, such as function calls.","example":null}},"required":["role","content"],"description":"A chat completion message generated by the model."},"finish_reason":{"type":"string","enum":["stop","length","content_filter","tool_calls"],"description":"The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag from our content filters, tool_calls if the model called a tool"},"logprobs":{"type":"object","nullable":true,"properties":{"content":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","nullable":true,"items":{"type":"object","properties":{"bytes":{"type":"array","nullable":true,"items":{"type":"integer"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."}},"required":["logprob","token"]},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned."}},"required":["bytes","logprob","token"]},"description":"A list of message content tokens with log probability information."},"refusal":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"array","items":{"type":"integer"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."},"top_logprobs":{"type":"array","nullable":true,"items":{"type":"object","properties":{"bytes":{"type":"array","nullable":true,"items":{"type":"integer"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"token":{"type":"string","description":"The token."}},"required":["logprob","token"]},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned."}},"required":["bytes","logprob","token"]},"description":"A list of message refusal tokens with log probability information."}},"required":["content","refusal"],"description":"Log probability information for the choice.","example":null}},"required":["index","message","finish_reason"]}},"model":{"type":"string","description":"The model used for the chat completion.","example":"gpt-4o-2024-08-06"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"number","description":"Number of tokens in the prompt.","example":137},"completion_tokens":{"type":"number","description":"Number of tokens in the generated completion.","example":914},"total_tokens":{"type":"number","description":"Total number of tokens used in the request (prompt + completion).","example":1051},"completion_tokens_details":{"type":"object","nullable":true,"properties":{"accepted_prediction_tokens":{"type":"integer","nullable":true,"description":"When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion."},"audio_tokens":{"type":"integer","nullable":true,"description":"Audio input tokens generated by the model."},"reasoning_tokens":{"type":"integer","nullable":true,"description":"Tokens generated by the model for reasoning."},"rejected_prediction_tokens":{"type":"integer","nullable":true,"description":"When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits."}},"description":"Breakdown of tokens used in a completion.","example":null},"prompt_tokens_details":{"type":"object","nullable":true,"properties":{"audio_tokens":{"type":"integer","nullable":true,"description":"Audio input tokens present in the prompt."},"cached_tokens":{"type":"integer","nullable":true,"description":"Cached tokens present in the prompt."}},"description":"Breakdown of tokens used in the prompt.","example":null}},"required":["prompt_tokens","completion_tokens","total_tokens"],"description":"Usage statistics for the completion request."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]},"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}},"required":["id","object","created","choices","model","usage"]}},"text/event-stream":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"A unique identifier for the chat completion."},"choices":{"type":"array","items":{"type":"object","properties":{"delta":{"type":"object","nullable":true,"properties":{"content":{"type":"string","description":"The contents of the chunk message."},"refusal":{"type":"string","nullable":true,"description":"The refusal message generated by the model."},"role":{"type":"string","enum":["user","assistant","developer","system","tool"],"description":"The role of the author of this message."},"tool_calls":{"type":"array","nullable":true,"items":{"type":"object","properties":{"index":{"type":"number"},"id":{"type":"string","description":"The ID of the tool call."},"function":{"type":"object","properties":{"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."},"name":{"type":"string"}},"required":["arguments","name"],"description":"The function that the model called."},"type":{"type":"string","enum":["function"],"description":"The type of the tool."}},"required":["index","id","function","type"]},"description":"The tool calls generated by the model, such as function calls."}},"required":["content","role"],"description":"A chat completion delta generated by streamed model responses."},"finish_reason":{"type":"string","enum":["length","function_call","stop","tool_calls","content_filter"]},"index":{"type":"number","description":"The index of the choice in the list of choices."},"logprobs":{"type":"object","nullable":true,"properties":{"content":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The token."},"bytes":{"type":"array","items":{"type":"number"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"top_logprobs":{"type":"array","nullable":true,"items":{"type":"object","properties":{"token":{"type":"string","description":"The token."},"bytes":{"type":"array","items":{"type":"number"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."}},"required":["token","bytes","logprob"]},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned."}},"required":["token","bytes","logprob"]}},"refusal":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The token."},"bytes":{"type":"array","items":{"type":"number"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."},"top_logprobs":{"type":"array","nullable":true,"items":{"type":"object","properties":{"token":{"type":"string","description":"The token."},"bytes":{"type":"array","items":{"type":"number"},"description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token."},"logprob":{"type":"number","description":"The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."}},"required":["token","bytes","logprob"]},"description":"List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned."}},"required":["token","bytes","logprob"]}}},"required":["content","refusal"],"description":"Log probability information for the choice."}},"required":["finish_reason","index"]},"description":"A list of chat completion choices. Can be more than one if n is greater than 1."},"created":{"type":"number","description":"The Unix timestamp (in seconds) of when the chat completion was created."},"model":{"type":"string","description":"The model used for the chat completion."},"object":{"type":"string","enum":["chat.completion.chunk"],"description":"The object type."},"service_tier":{"type":"string","nullable":true,"enum":["auto","default","flex","scale","priority"],"description":"Specifies the processing type used for serving the request."},"usage":{"type":"object","nullable":true,"properties":{"prompt_tokens":{"type":"number","description":"Number of tokens in the prompt.","example":137},"completion_tokens":{"type":"number","description":"Number of tokens in the generated completion.","example":914},"total_tokens":{"type":"number","description":"Total number of tokens used in the request (prompt + completion).","example":1051},"completion_tokens_details":{"type":"object","nullable":true,"properties":{"accepted_prediction_tokens":{"type":"integer","nullable":true,"description":"When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion."},"audio_tokens":{"type":"integer","nullable":true,"description":"Audio input tokens generated by the model."},"reasoning_tokens":{"type":"integer","nullable":true,"description":"Tokens generated by the model for reasoning."},"rejected_prediction_tokens":{"type":"integer","nullable":true,"description":"When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits."}},"description":"Breakdown of tokens used in a completion.","example":null},"prompt_tokens_details":{"type":"object","nullable":true,"properties":{"audio_tokens":{"type":"integer","nullable":true,"description":"Audio input tokens present in the prompt."},"cached_tokens":{"type":"integer","nullable":true,"description":"Cached tokens present in the prompt."}},"description":"Breakdown of tokens used in the prompt.","example":null}},"required":["prompt_tokens","completion_tokens","total_tokens"],"description":"Usage statistics for the completion request."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]},"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}},"required":["id","choices","created","model","object"]}}}}}}},"/v1/decisions":{"post":{"operationId":"_v1_decisions","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-6-luna","openai/gpt-6-luna"]},"input":{"anyOf":[{"type":"string","minLength":1,"maxLength":1048576},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["user"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"image_url":{"type":"string","description":"A base64 `data:` URL (`data:image/png;base64,…`) or an http(s) URL; we pass it to OpenAI inline."},"detail":{"type":"string","description":"Image detail, as OpenAI reads it (`low`, `high`, `auto`)."}},"required":["type","image_url"]}]},"minItems":1}]}},"required":["role","content"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["system","developer"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"]},"minItems":1}]}},"required":["role","content"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["output_text"]},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["refusal"]},"refusal":{"type":"string"}},"required":["type","refusal"]}]},"minItems":1}]}},"required":["role","content"]}]},"minItems":1}],"description":"Shared evidence for every question: a text string, or user/system/developer/assistant messages. User messages may combine `input_text` and `input_image` parts.","example":"I was charged twice for my order."},"questions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["predicate"],"description":"Check a condition; the answer is the probability that it is true."},"name":{"type":"string","minLength":1,"description":"A unique name; the answer echoes it."},"instructions":{"type":"string","minLength":1,"description":"What to evaluate: the condition, the routing rule, the rubric."}},"required":["type","name","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Select one of `choices`."},"name":{"type":"string","minLength":1,"description":"A unique name; the answer echoes it."},"instructions":{"type":"string","minLength":1,"description":"What to evaluate: the condition, the routing rule, the rubric."},"choices":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["value"]},"minItems":1,"description":"The options: a distinct `value` each, and when it applies. Include a fallback like `other` when the options do not cover every input.","example":[{"value":"billing","description":"Payments, invoices, and refunds."},{"value":"other","description":"Requests outside these categories."}]}},"required":["type","name","instructions","choices"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate against ordered `levels`; the answer is the probability-weighted level index (0-based)."},"name":{"type":"string","minLength":1,"description":"A unique name; the answer echoes it."},"instructions":{"type":"string","minLength":1,"description":"What to evaluate: the condition, the routing rule, the rubric."},"levels":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["label"]},"minItems":2,"description":"Ordered levels, lowest first.","example":[{"label":"Cosmetic","description":"Appearance only."},{"label":"Fully blocked","description":"No workaround."}]}},"required":["type","name","instructions","levels"]}]},"minItems":1,"maxItems":200,"description":"1–200 independent questions about the input; answers come back in the same order."},"prompt_cache_key":{"type":"string","maxLength":64,"description":"Partitions prompt cache reuse by a key you choose."}},"required":["model","input","questions"],"title":"gpt-6-luna, openai/gpt-6-luna"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-decision-1","google/gemini-decision-1"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts. Text only: `image_url`, `input_audio`, `video_url` and `file` parts are refused.","example":"The blue mug I ordered on Monday arrived cracked on Wednesday."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":2,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1,"maxProperties":1000},"images":{"type":"array","items":{"nullable":true},"maxItems":0,"description":"Not supported: This model reads text only: images are not supported. A non-empty list is refused."},"assets":{"type":"object","additionalProperties":{"nullable":true},"description":"Not supported here: This model takes no `assets`: it reads text only. A non-empty map is refused."}},"required":["model","state","questions"],"title":"gemini-decision-1, google/gemini-decision-1"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1","liquid/d1.1","liquid/d1-ultra"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts. Leave it out when the questions stand alone.","example":"Help! My payments have been failing for 3 days."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":2,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1,"maxProperties":128},"images":{"type":"array","items":{"type":"string","format":"uri","description":"A JPEG, PNG or WebP image: a base64 `data:` URL (`data:image/png;base64,…`) or an http(s) URL."},"maxItems":8,"description":"Up to 8 images of the state, in order: every question sees all of them, so refer to an image by its position. Each one counts as input tokens — 1.5 per 32×32-pixel patch (a 1024×1024 image is 1,536) — again for every question. At most 10,000 patches across the images, a side at most 100 times the other and 4.5 MiB for the whole request once the images are inlined. Images are never resized: one outside these limits is refused with a 400 that says what to change."},"assets":{"type":"object","additionalProperties":{"nullable":true},"description":"Not supported here: This model takes no `assets`: send its images in `images`. A non-empty map is refused."}},"required":["model","questions"],"title":"liquid/d1, liquid/d1.1, liquid/d1-ultra"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev","jev","typesafe/jev-1.14","jev-1.14","jev-1.14.0"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts.","example":"Help! My payments have been failing for 3 days."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":1,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["box"],"description":"Where something is in an image: the answer is the four edges of a box around it, as fractions of the width and height, with a confidence. Experimental (TypeSafe: not production-ready yet). Needs an image in `assets`; there is no \"not found\" answer, so pair it with a `noul` asking whether the target is there."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to find, and in which image — e.g. \"the coffee mug in `photo`\". Box takes no `criteria`."}},"required":["type","instructions"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1},"images":{"type":"array","items":{"nullable":true},"maxItems":0,"description":"Not supported: This model takes images in `assets` (TypeSafe’s format), not in `images`. A non-empty list is refused."},"assets":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["image"],"description":"The kind of asset. Optional; when sent, `image`."},"format":{"type":"string","enum":["png","jpg","jpeg"],"description":"The image format, lowercase; `jpeg` is `jpg`."},"data_base64":{"type":"string","minLength":1,"description":"The PNG or JPEG file, base64-encoded: the standard alphabet with `=` padding, no line breaks or whitespace, no `data:` prefix."}},"required":["format","data_base64"]},"description":"Images, keyed by a reference string (a new UUID per image is safest). Write the reference wherever the image belongs — as a whole string value, or inside a longer string of the state, an instruction or a criterion — and the model reads the image there; refer to an image in the state by its path in backticks, e.g. `photo`. Every asset must be referenced; each use adds the image again. PNG or JPEG stills, 280–1568 pixels a side, at most 16 MiB each: images are never resized, and one outside these limits is refused with a 400 that says what to change. Image tokens are billed as input tokens. Experimental (TypeSafe: not production-ready yet).","example":{"a3f1c2e8-door":{"type":"image","format":"jpg","data_base64":"/9j/4AAQSkZJRg..."}}}},"required":["model","state","questions"],"title":"typesafe/jev, jev, typesafe/jev-1.14, jev-1.14, jev-1.14.0"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev","jev","typesafe/jev-1.14","jev-1.14","jev-1.14.0"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts.","example":"Help! My payments have been failing for 3 days."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":1,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["box"],"description":"Where something is in an image: the answer is the four edges of a box around it, as fractions of the width and height, with a confidence. Experimental (TypeSafe: not production-ready yet). Needs an image in `assets`; there is no \"not found\" answer, so pair it with a `noul` asking whether the target is there."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to find, and in which image — e.g. \"the coffee mug in `photo`\". Box takes no `criteria`."}},"required":["type","instructions"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1},"images":{"type":"array","items":{"nullable":true},"maxItems":0,"description":"Not supported: This model takes images in `assets` (TypeSafe’s format), not in `images`. A non-empty list is refused."},"assets":{"type":"object","additionalProperties":{"nullable":true},"description":"Not supported here: Images in `assets` reach this model only through its own provider’s API, and this request reached a fallback that would drop them. Retry shortly. A non-empty map is refused."}},"required":["model","state","questions"],"title":"typesafe/jev, jev, typesafe/jev-1.14, jev-1.14, jev-1.14.0"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-1.13","jev-1.13","jev-1.13.0"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts.","example":"Help! My payments have been failing for 3 days."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":1,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1},"images":{"type":"array","items":{"nullable":true},"maxItems":0,"description":"Not supported: This model takes images in `assets` (TypeSafe’s format), not in `images`. A non-empty list is refused."},"assets":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["image"],"description":"The kind of asset. Optional; when sent, `image`."},"format":{"type":"string","enum":["png","jpg","jpeg"],"description":"The image format, lowercase; `jpeg` is `jpg`."},"data_base64":{"type":"string","minLength":1,"description":"The PNG or JPEG file, base64-encoded: the standard alphabet with `=` padding, no line breaks or whitespace, no `data:` prefix."}},"required":["format","data_base64"]},"description":"Images, keyed by a reference string (a new UUID per image is safest). Write the reference wherever the image belongs — as a whole string value, or inside a longer string of the state, an instruction or a criterion — and the model reads the image there; refer to an image in the state by its path in backticks, e.g. `photo`. Every asset must be referenced; each use adds the image again. PNG or JPEG stills, 280–1568 pixels a side, at most 16 MiB each: images are never resized, and one outside these limits is refused with a 400 that says what to change. Image tokens are billed as input tokens. Experimental (TypeSafe: not production-ready yet).","example":{"a3f1c2e8-door":{"type":"image","format":"jpg","data_base64":"/9j/4AAQSkZJRg..."}}}},"required":["model","state","questions"],"title":"typesafe/jev-1.13, jev-1.13, jev-1.13.0"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-1.13","jev-1.13","jev-1.13.0"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts.","example":"Help! My payments have been failing for 3 days."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"yes\"."},"false":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question: text, or a JSON object/array."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"description":"Option key → description: text, a JSON object/array, or `null` when the key says it all. The answer is one of these keys plus a probability for each.","minProperties":1,"maxProperties":255,"example":{"billing":"Payments, invoicing, refunds","technical":"Bugs, outages, integrations"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array (the question in one field, data it refers to in others)."},"criteria":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"minItems":2,"maxItems":10,"description":"Ordered level descriptions (text or a JSON object/array each), lowest first. The answer is an expected level index (may be fractional) plus a probability per level.","example":["Calm","Frustrated","Very angry"]}},"required":["type","instructions","criteria"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result.","minProperties":1},"images":{"type":"array","items":{"nullable":true},"maxItems":0,"description":"Not supported: This model takes images in `assets` (TypeSafe’s format), not in `images`. A non-empty list is refused."},"assets":{"type":"object","additionalProperties":{"nullable":true},"description":"Not supported here: Images in `assets` reach this model only through its own provider’s API, and this request reached a fallback that would drop them. Retry shortly. A non-empty map is refused."}},"required":["model","state","questions"],"title":"typesafe/jev-1.13, jev-1.13, jev-1.13.0"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","description":"Resolved model version that answered."},"answers":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"]},"noul":{"type":"number","description":"Probability that the answer is \"yes\" (0–1)."}},"required":["type","noul"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"choice":{"type":"string","description":"The selected option key from `criteria`."},"confidence":{"type":"number","description":"Calibrated confidence in the choice (0–1)."},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"Probability of each option; sums to 1."}},"required":["type","choice","confidence","probabilities"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"score":{"type":"number","description":"Expected level on the ordered scale (may be fractional, e.g. 1.34)."},"confidence":{"type":"number","description":"Calibrated confidence in the score (0–1)."},"legend":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}]},"description":"Level index → level description, as the request gave it (text, or a JSON object/array)."},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"Probability of each option; sums to 1."}},"required":["type","score","confidence","legend","probabilities"]},{"type":"object","properties":{"type":{"type":"string","enum":["box"]},"box":{"type":"object","properties":{"top":{"type":"number"},"bottom":{"type":"number"},"left":{"type":"number"},"right":{"type":"number"}},"required":["top","bottom","left","right"],"description":"The edges of the box around the target, each a fraction (0–1) from the top-left corner: `left` and `right` of the width, `top` and `bottom` of the height."},"confidence":{"type":"number","description":"How sure the model is of the box (0–1)."}},"required":["type","box","confidence"]}]},"description":"One typed answer per question key from the request."},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}},"required":["input_tokens","output_tokens"],"description":"Token usage reported by the provider."}},"required":["model","answers","usage"]},{"type":"object","properties":{"model":{"type":"string","description":"The model that answered."},"answers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["predicate"]},"name":{"type":"string","description":"The question’s `name`."},"probability":{"type":"number","description":"Probability that the condition is true (0–1)."}},"required":["type","name","probability"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"name":{"type":"string","description":"The question’s `name`."},"choice":{"type":"string","description":"The selected `value` from `choices`."},"confidence":{"type":"number","description":"Confidence (0–1)."},"probabilities":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"probability":{"type":"number"}},"required":["value","probability"]},"description":"Probability of each choice."}},"required":["type","name","choice","confidence","probabilities"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"name":{"type":"string","description":"The question’s `name`."},"score":{"type":"number","description":"Probability-weighted average of the level indices (0-based; may fall between levels)."},"confidence":{"type":"number","description":"Confidence (0–1)."},"probabilities":{"type":"array","items":{"type":"object","properties":{"value":{"type":"integer"},"label":{"type":"string"},"probability":{"type":"number"}},"required":["value","label","probability"]},"description":"Probability of each level."}},"required":["type","name","score","confidence","probabilities"]},{"type":"object","properties":{"type":{"type":"string","enum":["refusal"]},"name":{"type":"string","description":"The question’s `name`."}},"required":["type","name"]}]},"description":"One answer per question, in request order."},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"},"cache_write_tokens":{"type":"integer"}}},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"required":["input_tokens","output_tokens","total_tokens"],"description":"Token usage reported by the provider."}},"required":["model","answers","usage"]}]}}}}}}},"/v1/embeddings":{"post":{"operationId":"_v1_embeddings","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["text-embedding-3-small","openai/text-embedding-3-small","text-embedding-3-large","openai/text-embedding-3-large"]},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string"},"minItems":1},{"type":"array","items":{"type":"integer","minimum":0},"minItems":1},{"type":"array","items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":1},"minItems":1}],"description":"Input text to embed, encoded as a string or array of tokens."},"encoding_format":{"type":"string","enum":["float","base64"],"default":"float","description":"The format in which to return the embeddings."},"dimensions":{"type":"number","nullable":true,"minimum":1,"maximum":3072,"description":"The number of dimensions for the embedding. Default is 1024."}},"required":["model","input"],"title":"text-embedding-3-small, openai/text-embedding-3-small, text-embedding-3-large, openai/text-embedding-3-large"},{"type":"object","properties":{"model":{"type":"string","enum":["text-embedding-ada-002","openai/text-embedding-ada-002"]},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string"},"minItems":1},{"type":"array","items":{"type":"integer","minimum":0},"minItems":1},{"type":"array","items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":1},"minItems":1}],"description":"Input text to embed, encoded as a string or array of tokens."},"encoding_format":{"type":"string","enum":["float","base64"],"default":"float","description":"The format in which to return the embeddings."}},"required":["model","input"],"title":"text-embedding-ada-002, openai/text-embedding-ada-002"},{"type":"object","properties":{"model":{"type":"string","enum":["voyage-large-2-instruct","anthropic/voyage-large-2-instruct","voyage-finance-2","anthropic/voyage-finance-2","voyage-multilingual-2","anthropic/voyage-multilingual-2","voyage-law-2","anthropic/voyage-law-2","voyage-code-2","anthropic/voyage-code-2","voyage-large-2","anthropic/voyage-large-2","voyage-2","anthropic/voyage-2"]},"input":{"anyOf":[{"type":"string","minLength":1,"maxLength":8000},{"type":"array","items":{"type":"string","maxLength":800}}],"description":"Input text to embed, encoded as a string or array of tokens."},"input_type":{"type":"string","enum":["document"],"default":"document","description":"The type of input data for the model."}},"required":["model","input"],"title":"voyage-large-2-instruct, anthropic/voyage-large-2-instruct, voyage-finance-2, anthropic/voyage-finance-2, voyage-multilingual-2, anthropic/voyage-multilingual-2, voyage-law-2, anthropic/voyage-law-2, voyage-code-2, anthropic/voyage-code-2, voyage-large-2, anthropic/voyage-large-2, voyage-2, anthropic/voyage-2"},{"type":"object","properties":{"model":{"type":"string","enum":["text-multilingual-embedding-002","google/text-multilingual-embedding-002"]},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string"},"minItems":1}],"description":"Input text to embed, encoded as a string or array of tokens."},"dimensions":{"type":"number","nullable":true,"minimum":1,"maximum":768,"description":"The number of dimensions for the embedding. Default is 1024."},"auto_truncate":{"type":"boolean","default":true,"description":"If enabled, this parameter automatically truncates the input text to fit within the model’s maximum token limit. It helps ensure that longer texts are processed without errors."},"task_type":{"type":"string","enum":["RETRIEVAL_QUERY","RETRIEVAL_DOCUMENT","SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","QUESTION_ANSWERING","FACT_VERIFICATION"],"description":"Optional task type for which the embeddings will be used."},"title":{"type":"string","description":"An optional title for the text. Only applicable when task_type is RETRIEVAL_DOCUMENT.\n  \n  Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval."}},"required":["model","input"],"title":"text-multilingual-embedding-002, google/text-multilingual-embedding-002"},{"type":"object","properties":{"model":{"type":"string","enum":["text-embedding-v4","alibaba/text-embedding-v4","text-embedding-v3","alibaba/text-embedding-v3","alibaba/qwen-text-embedding-v4","alibaba/qwen-text-embedding-v3"]},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string"},"minItems":1}],"description":"Input text to embed, encoded as a string or array of tokens."},"dimensions":{"type":"integer","minimum":64,"maximum":2048,"default":1024,"description":"The number of dimensions for the embedding. Default is 1024."}},"required":["model","input"],"title":"text-embedding-v4, alibaba/text-embedding-v4, text-embedding-v3, alibaba/text-embedding-v3, alibaba/qwen-text-embedding-v4, alibaba/qwen-text-embedding-v3"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["object"]},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","enum":["embedding"]},"index":{"type":"number"},"embedding":{"type":"array","items":{"type":"number"}}},"required":["object","index","embedding"]}},"model":{"type":"string"},"usage":{"type":"object","properties":{"total_tokens":{"type":"number","nullable":true}}},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}}}},"required":["object","data","model","usage"]}}}}}}},"/v1/images/generations":{"post":{"operationId":"_v1_images_generations","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-image-1-mini","openai/gpt-image-1-mini","gpt-image-1.5","openai/gpt-image-1.5","gpt-image-2","openai/gpt-image-2","gpt-image-2.5-sunburst","openai/gpt-image-2.5-sunburst","gpt-image-2.5-flare","openai/gpt-image-2.5-flare","openai/gpt-image-1-5"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"n":{"type":"number","enum":[1],"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gpt-image-1-mini, openai/gpt-image-1-mini, gpt-image-1.5, openai/gpt-image-1.5, gpt-image-2, openai/gpt-image-2, gpt-image-2.5-sunburst, openai/gpt-image-2.5-sunburst, gpt-image-2.5-flare, openai/gpt-image-2.5-flare, openai/gpt-image-1-5"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-image-2.6-sunburst","openai/gpt-image-2.6-sunburst","gpt-image-2.6-flare","openai/gpt-image-2.6-flare"]},"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"size":{"type":"string","description":"Size of each image as WIDTHxHEIGHT, or auto. Width and height are multiples of 16, the aspect ratio is between 1:3 and 3:1, no edge exceeds 3840 pixels and the image has at most 8,294,400 pixels (at least 655,360 except for GIF frames). For GIF output, the size of one frame. Defaults to 1024x1024, or to auto for GIF output.","example":"1536x1024"},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"],"default":"medium","description":"Rendering quality. xhigh and max cost more output tokens; auto lets the model choose."},"complexity":{"type":"string","enum":["low","medium","high"],"default":"high","description":"How much the model plans the image before rendering, independently of quality. Higher complexity helps dense text and complex layouts and can add latency."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Background of the image. transparent needs output_format png or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"Number of images to generate, from 1 to 10."},"frame_count":{"type":"integer","minimum":2,"maximum":16,"description":"Number of GIF frames, from 2 to 16. Only with output_format gif. Defaults to 9."},"frame_duration_ms":{"type":"integer","minimum":20,"maximum":655350,"description":"Delay per GIF frame in milliseconds, rounded to 10 ms. Only with output_format gif. Defaults to 200."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"output_format":{"type":"string","enum":["png","jpeg","webp","gif"],"default":"png","description":"Output format. gif returns an animation (see frame_count)."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gpt-image-2.6-sunburst, openai/gpt-image-2.6-sunburst, gpt-image-2.6-flare, openai/gpt-image-2.6-flare"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedream-4-5","bytedance/seedream-5-0-lite","bytedance/seedream-5-0-lite-preview"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":14,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":1440,"maximum":4096,"default":2048},"height":{"type":"integer","minimum":1440,"maximum":4096,"default":2048}}},{"type":"string","enum":["2K","4K"]}],"description":"The size of the generated image."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/seedream-4-5, bytedance/seedream-5-0-lite, bytedance/seedream-5-0-lite-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/dola-seedream-5-0-pro","bytedance/seedream-5-0-pro"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":14,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":1024,"maximum":2752},"height":{"type":"integer","minimum":1024,"maximum":2752}},"required":["width","height"]},{"type":"string","enum":["1.5K","2K"]}],"default":"1.5K","description":"The size of the generated image."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/dola-seedream-5-0-pro, bytedance/seedream-5-0-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/dreamina-creative-upscale"]},"image_url":{"type":"string","format":"uri","description":"URL or data URL of the input image to upscale. JPEG or PNG, up to 4.7MB and 4096×4096 px."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Target output resolution. Defaults to \"2k\"."},"scale":{"type":"integer","minimum":0,"maximum":100,"default":50,"description":"Degree of detail generation, from 0 to 100. Defaults to 50."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"Format of the returned image: a hosted URL (\"url\") or base64-encoded data (\"b64_json\"). Defaults to \"url\"."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"bytedance/dreamina-creative-upscale"},{"type":"object","properties":{"model":{"type":"string","enum":["imagen-3.0-generate-002","google/imagen-3.0-generate-002","imagen-4.0-generate-001","google/imagen-4.0-generate-001","imagen-4.0-fast-generate-001","google/imagen-4.0-fast-generate-001","imagen-4.0-ultra-generate-001","google/imagen-4.0-ultra-generate-001","google/imagen4/preview"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"default":"1:1","description":"The aspect ratio of the generated image."},"enhance_prompt":{"type":"boolean","default":true,"description":"Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment."},"num_images":{"type":"integer","maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"safety_setting":{"type":"string","enum":["block_low_and_above","block_medium_and_above","block_only_high"],"default":"block_medium_and_above","description":"Adds a filter level to safety filtering."},"add_watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"imagen-3.0-generate-002, google/imagen-3.0-generate-002, imagen-4.0-generate-001, google/imagen-4.0-generate-001, imagen-4.0-fast-generate-001, google/imagen-4.0-fast-generate-001, imagen-4.0-ultra-generate-001, google/imagen-4.0-ultra-generate-001, google/imagen4/preview"},{"type":"object","properties":{"model":{"type":"string","enum":["nano-banana-pro","google/nano-banana-pro","google/gemini-3-pro-image","gemini-3-pro-image","google/gemini-3-pro-image-preview"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"default":"1:1","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The resolution of the output image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"nano-banana-pro, google/nano-banana-pro, google/gemini-3-pro-image, gemini-3-pro-image, google/gemini-3-pro-image-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-3-pro-image-preview-edit","google/gemini-3-pro-image-preview-edit","nano-banana-pro-edit","google/nano-banana-pro-edit","google/gemini-3-pro-image-edit"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"description":"The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The resolution of the output image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-3-pro-image-preview-edit, google/gemini-3-pro-image-preview-edit, nano-banana-pro-edit, google/nano-banana-pro-edit, google/gemini-3-pro-image-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["nano-banana","google/nano-banana","google/gemini-2.5-flash-image","gemini-2.5-flash-image"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"default":"1:1","description":"The aspect ratio of the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Seed for reproducible results. With num_images above 1, the n-th image (counting from 0) uses seed + n."},"safety_setting":{"type":"string","enum":["block_low_and_above","block_medium_and_above","block_only_high"],"description":"Blocking threshold applied to the hate speech, dangerous content, harassment and sexually explicit categories. If omitted, Google's default filtering applies."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"nano-banana, google/nano-banana, google/gemini-2.5-flash-image, gemini-2.5-flash-image"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-2.5-flash-image-edit","google/gemini-2.5-flash-image-edit","nano-banana-edit","google/nano-banana-edit"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"description":"The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Seed for reproducible results. With num_images above 1, the n-th image (counting from 0) uses seed + n."},"safety_setting":{"type":"string","enum":["block_low_and_above","block_medium_and_above","block_only_high"],"description":"Blocking threshold applied to the hate speech, dangerous content, harassment and sexually explicit categories. If omitted, Google's default filtering applies."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-2.5-flash-image-edit, google/gemini-2.5-flash-image-edit, nano-banana-edit, google/nano-banana-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["google/imagen4/preview","imagen4/preview"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","3:4","4:3"],"default":"1:1","description":"The aspect ratio of the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"google/imagen4/preview, imagen4/preview"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-pro-image-edit","google/gemini-3-pro-image-preview-edit","google/nano-banana-pro-edit","gemini-3-pro-image-preview/edit"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"description":"List of URLs or local Base64 encoded images to edit. Supports up to 14 images."},"aspect_ratio":{"type":"string","enum":["auto","21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"default":"auto","description":"The aspect ratio of the generated image. If not specified, the aspect_ratio of the last provided reference image is used by default."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The size of the generated image."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"google/gemini-3-pro-image-edit, google/gemini-3-pro-image-preview-edit, google/nano-banana-pro-edit, gemini-3-pro-image-preview/edit"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-2.5-flash-image-edit","google/nano-banana-edit","gemini-25-flash-image/edit"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of URLs or local Base64 encoded images to edit."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"aspect_ratio":{"type":"string","enum":["21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"description":"The aspect ratio of the generated image. If not specified, the aspect_ratio of the last provided reference image is used by default."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"google/gemini-2.5-flash-image-edit, google/nano-banana-edit, gemini-25-flash-image/edit"},{"type":"object","properties":{"model":{"type":"string","enum":["google/gemini-3-1-flash-lite-image","google/nano-banana-2-lite","google/nano-banana-lite","google/gemini-3.1-flash-image","gemini-3.1-flash-image","google/gemini-3-1-flash-image-preview","google/nano-banana-2","google/gemini-3.1-flash-image-preview","gemini-3.1-flash-image-preview","google/gemini-3.1-flash-lite-image","gemini-3.1-flash-lite-image","google/gemini-nano-banana-2.1","gemini-nano-banana-2.1","google/nano-banana-2.1"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"],"description":"The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The resolution of the output image."},"enable_web_search":{"type":"boolean","default":false,"description":"Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"google/gemini-3-1-flash-lite-image, google/nano-banana-2-lite, google/nano-banana-lite, google/gemini-3.1-flash-image, gemini-3.1-flash-image, google/gemini-3-1-flash-image-preview, google/nano-banana-2, google/gemini-3.1-flash-image-preview, gemini-3.1-flash-image-preview, google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image, google/gemini-nano-banana-2.1, gemini-nano-banana-2.1, google/nano-banana-2.1"},{"type":"object","properties":{"model":{"type":"string","enum":["meta/muse-image","muse-image"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"description":"The aspect ratio of the generated image. If omitted, Muse chooses the output dimensions automatically based on the prompt."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"webp","description":"The format of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"meta/muse-image, muse-image"},{"type":"object","properties":{"model":{"type":"string","enum":["meta/muse-image-edit","muse-image-edit"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"List of URLs or local Base64 encoded images to edit."},"num_images":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"description":"The aspect ratio of the edited image. If omitted, the aspect ratio of the last provided reference image is used."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"webp","description":"The format of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"meta/muse-image-edit, muse-image-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen-image-edit","alibaba/qwen-image-edit"]},"prompt":{"type":"string","maxLength":800,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"type":"string","format":"uri","description":"The image to be edited. Enter the Base64 encoding of the picture or an accessible URL. Image URL: Make sure that the image URL is accessible. Base64-encoded content: The format must be in lowercase."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image"],"title":"qwen-image-edit, alibaba/qwen-image-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen-image","alibaba/qwen-image"]},"prompt":{"type":"string","maxLength":2000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1440},"height":{"type":"integer","minimum":512,"maximum":1440}},"required":["width","height"],"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3","description":"The size of the generated image."},"prompt_extend":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"seed":{"type":"integer","minimum":1,"maximum":2147483647,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"provider":{"type":"string","description":"Provider routing override. `alibaba` runs native Alibaba with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Alibaba -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"qwen-image, alibaba/qwen-image"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.5-t2i-preview","alibaba/wan2.5-t2i-preview","wan2.2-t2i-plus","alibaba/wan2.2-t2i-plus","wan2.2-t2i-flash","alibaba/wan2.2-t2i-flash"]},"prompt":{"type":"string","maxLength":2000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1440},"height":{"type":"integer","minimum":512,"maximum":1440}},"required":["width","height"],"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3","description":"The size of the generated image."},"prompt_extend":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"seed":{"type":"integer","minimum":1,"maximum":2147483647,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.5-t2i-preview, alibaba/wan2.5-t2i-preview, wan2.2-t2i-plus, alibaba/wan2.2-t2i-plus, wan2.2-t2i-flash, alibaba/wan2.2-t2i-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen-image-2.0","alibaba/qwen-image-2.0","qwen-image-2.0-pro","alibaba/qwen-image-2.0-pro","wan2.6-image","alibaba/wan2.6-image","wan2.7-image","alibaba/wan2.7-image","wan2.7-image-pro","alibaba/wan2.7-image-pro","alibaba/wan-2-6-image","alibaba/wan-2-7-image","alibaba/wan-2-7-image-pro","alibaba/qwen-image-2-0","alibaba/qwen-image-2-0-pro"]},"prompt":{"type":"string","maxLength":2000,"description":"A positive prompt that describes the desired elements and visual features in the edited image."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1440},"height":{"type":"integer","minimum":512,"maximum":1440}},"required":["width","height"],"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3","description":"The size of the generated image."},"enhance_prompt":{"type":"boolean","default":true,"description":"Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"qwen-image-2.0, alibaba/qwen-image-2.0, qwen-image-2.0-pro, alibaba/qwen-image-2.0-pro, wan2.6-image, alibaba/wan2.6-image, wan2.7-image, alibaba/wan2.7-image, wan2.7-image-pro, alibaba/wan2.7-image-pro, alibaba/wan-2-6-image, alibaba/wan-2-7-image, alibaba/wan-2-7-image-pro, alibaba/qwen-image-2-0, alibaba/qwen-image-2-0-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["z-image-turbo","alibaba/z-image-turbo"]},"provider":{"type":"string","description":"Provider routing override. `alibaba` runs native Alibaba with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Alibaba -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":800,"description":"Text prompt for image generation (max 800 chars)"},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1440},"height":{"type":"integer","minimum":512,"maximum":1440}},"required":["width","height"],"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3","description":"The size of the generated image."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"prompt_extend":{"type":"boolean","default":false,"description":"Enable intelligent prompt rewriting"},"num_inference_steps":{"type":"integer","minimum":1,"maximum":8,"description":"The number of inference steps to perform."},"seed":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Random seed for reproducible results"},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"z-image-turbo, alibaba/z-image-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/z-image-turbo","z-image/turbo"]},"provider":{"type":"string","description":"Provider routing override. `alibaba` runs native Alibaba with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Alibaba -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":8,"description":"The number of inference steps to perform."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"alibaba/z-image-turbo, z-image/turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen-image","qwen-image"]},"provider":{"type":"string","description":"Provider routing override. `alibaba` runs native Alibaba with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Alibaba -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"alibaba/qwen-image, qwen-image"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/z-image-turbo-lora","z-image/turbo/lora"]},"provider":{"type":"string","description":"Provider routing override. `alibaba` runs native Alibaba with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Alibaba -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":8,"description":"The number of inference steps to perform."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"loras":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"URL, HuggingFace repo ID (owner/repo)."},"scale":{"type":"number","minimum":0,"maximum":4,"description":"Scale factor for LoRA application."}},"required":["path"]},"maxItems":3,"description":"List of LoRA weights to apply (maximum 3). Each LoRA can be a URL, HuggingFace repo ID, or local path."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"alibaba/z-image-turbo-lora, z-image/turbo/lora"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen-image-3"]},"prompt":{"type":"string","maxLength":800,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":384,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":384,"maximum":2048,"default":1024}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"square_hd"},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"alibaba/qwen-image-3"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/qwen-image-3-edit"]},"prompt":{"type":"string","maxLength":800,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":384,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":384,"maximum":2048,"default":1024}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"description":"Size of the generated image. Defaults to the size of the first input image."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"alibaba/qwen-image-3-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/image-01"]},"prompt":{"type":"string","minLength":1,"maxLength":1500,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_url":{"type":"string","format":"uri","description":"A photo of the person to keep in the generated images (subject reference): a public URL or a base64 data URL, JPG or PNG under 10 MB. A single front-facing portrait works best."},"aspect_ratio":{"type":"string","enum":["1:1","16:9","4:3","3:2","2:3","3:4","9:16","21:9"],"default":"1:1","description":"The aspect ratio of the generated image."},"num_images":{"type":"integer","minimum":1,"maximum":9,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enhance_prompt":{"type":"boolean","default":false,"description":"Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/image-01"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3-image","MiniMax-H3-Image","minimax/h3-image-highspeed","MiniMax-H3-Image-Highspeed"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":16,"description":"Reference images to edit or combine (1–16): public URLs or base64 data URLs. The prompt can name them in order as Picture 1, Picture 2, …"},"num_images":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"image_size":{"anyOf":[{"type":"string","enum":["1K","2K","4K"]},{"type":"object","properties":{"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1}},"required":["width","height"]}],"default":"4K","description":"The output size: a preset area level (1K ≈ 1 MP, 2K ≈ 4 MP, 4K ≈ 16 MP; default 4K) combined with aspect_ratio, or an exact width and height (655,360–20,000,000 pixels, between 1:3 and 3:1)."},"aspect_ratio":{"type":"string","description":"The aspect ratio of the generated images: \"auto\" (MiniMax picks) or W:H between 1:3 and 3:1, e.g. 16:9. Applies with a preset image_size; a width/height image_size fixes the ratio itself."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"jpeg","description":"The format of the generated image."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"description":"JPEG/WebP quality from 0 to 100 (MiniMax default 95). Ignored for PNG."},"enhance_prompt":{"type":"boolean","default":true,"description":"Let MiniMax rewrite the prompt for better results (default true). Text-to-image only: edits always enhance. When false, set a width/height image_size or a concrete aspect_ratio."},"watermark":{"type":"boolean","default":false,"description":"Add MiniMax’s AIGC watermark to the images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/h3-image, MiniMax-H3-Image, minimax/h3-image-highspeed, MiniMax-H3-Image-Highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-imagine-image","grok-imagine-image-2026-03-02","x-ai/grok-imagine-image-pro"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"default":"16:9","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"x-ai/grok-imagine-image, grok-imagine-image-2026-03-02, x-ai/grok-imagine-image-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-imagine-image-2.0","grok-imagine-image-2.0"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","21:9","5:2","auto"],"default":"auto","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1k","1.5k","2k"],"default":"1k","description":"The resolution of the output image. A higher resolution costs more."},"quality":{"type":"string","enum":["low","medium"],"default":"low","description":"The quality of the image that will be generated. `medium` renders more detail and costs more than `low` at the same resolution."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"x-ai/grok-imagine-image-2.0, grok-imagine-image-2.0"},{"type":"object","properties":{"model":{"type":"string","enum":["reve/create-image"]},"aspect_ratio":{"type":"string","enum":["16:9","9:16","3:2","2:3","4:3","3:4","1:1"],"default":"3:2","description":"The aspect ratio of the generated image."},"prompt":{"type":"string","maxLength":2560,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"reve/create-image"},{"type":"object","properties":{"model":{"type":"string","enum":["reve/edit-image"]},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"prompt":{"type":"string","maxLength":2560,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","prompt"],"title":"reve/edit-image"},{"type":"object","properties":{"model":{"type":"string","enum":["reve/remix-edit-image"]},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","3:2","2:3","4:3","3:4","1:1"],"default":"3:2","description":"The aspect ratio of the generated image."},"prompt":{"type":"string","maxLength":2560,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"convert_base64_to_url":{"type":"boolean","default":true,"description":"If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_urls","prompt"],"title":"reve/remix-edit-image"},{"type":"object","properties":{"model":{"type":"string","enum":["sharpen","topaz-labs/sharpen"]},"mode":{"type":"string","enum":["Standard","Strong","Lens Blur","Lens Blur V2","Motion Blur","Natural","Refocus"]},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"output_format":{"type":"string","enum":["jpeg","jpg","png","tiff","tif"],"default":"jpeg","description":"The format of the generated image."},"subject_detection":{"type":"string","enum":["All","Foreground","Background"],"default":"All","description":"Specifies which subjects to detect and process. Options: 'All' (detect all subjects), 'Foreground' (detect only foreground subjects), 'Background' (detect background subjects)."},"face_enhancement":{"type":"boolean","default":true,"description":"Whether to enhance faces in the image. When true, the model applies face-specific improvements."},"face_enhancement_creativity":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Level of creativity for face enhancement (0-1). Higher values allow more creative, less conservative changes."},"face_enhancement_strength":{"type":"number","minimum":0,"maximum":1,"default":0.8,"description":"How sharp enhanced faces are relative to background (0-1). Lower values blend changes subtly; higher values make faces more pronounced."},"strength":{"type":"number","minimum":0.01,"maximum":1,"description":"Defines the overall intensity of the sharpening effect. Increases details. Too much sharpening can create an unrealistic result."},"minor_denoise":{"type":"number","minimum":0.01,"maximum":1,"description":"Removes noisy pixels to increase clarity. Can slightly increase image sharpness."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","mode","image_url"],"title":"sharpen, topaz-labs/sharpen"},{"type":"object","properties":{"model":{"type":"string","enum":["sharpen-gen","topaz-labs/sharpen-gen"]},"mode":{"type":"string","enum":["Super Focus","Super Focus V2"]},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"output_format":{"type":"string","enum":["jpeg","jpg","png","tiff","tif"],"default":"jpeg","description":"The format of the generated image."},"subject_detection":{"type":"string","enum":["All","Foreground","Background"],"default":"All","description":"Specifies which subjects to detect and process. Options: 'All' (detect all subjects), 'Foreground' (detect only foreground subjects), 'Background' (detect background subjects)."},"face_enhancement":{"type":"boolean","default":true,"description":"Whether to enhance faces in the image. When true, the model applies face-specific improvements."},"face_enhancement_creativity":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Level of creativity for face enhancement (0-1). Higher values allow more creative, less conservative changes."},"face_enhancement_strength":{"type":"number","minimum":0,"maximum":1,"default":0.8,"description":"How sharp enhanced faces are relative to background (0-1). Lower values blend changes subtly; higher values make faces more pronounced."},"strength":{"type":"number","minimum":0,"maximum":1,"description":"Defines the overall intensity of the sharpening effect. Increases details. Too much sharpening can create an unrealistic result."},"focus_boost":{"type":"number","minimum":0.25,"maximum":1,"description":"Corrects images that are missing detail by downscaling your image then upscaling the results back to the original size. Use on very blurry images!"},"seed":{"type":"integer","description":"Optional fixed seed for repeatable results."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","mode","image_url"],"title":"sharpen-gen, topaz-labs/sharpen-gen"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/image-o1","kling-image/o1"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1K","2K"],"default":"1K","description":"The resolution of the output image."},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"num_images":{"type":"number","minimum":1,"maximum":9,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"klingai/image-o1, kling-image/o1"},{"type":"object","properties":{"model":{"type":"string","enum":["luma/uni-1","luma/uni-1-max"]},"prompt":{"type":"string","minLength":1,"maxLength":6000,"description":"Text description of the image to generate."},"type":{"type":"string","enum":["image","image_edit"],"default":"image","description":"Generation kind: \"image\" (text-to-image / reference) or \"image_edit\"."},"aspect_ratio":{"type":"string","enum":["3:1","2:1","16:9","3:2","1:1","2:3","9:16","1:2","1:3"],"description":"Output aspect ratio. Omit to let the model choose automatically."},"style":{"type":"string","enum":["auto","manga"],"default":"auto","description":"Rendering style. Defaults to \"auto\"."},"output_format":{"type":"string","enum":["png","jpeg"],"description":"Output image format (png or jpeg)."},"web_search":{"type":"boolean","default":false,"description":"Ground the generation with web search."},"image_url":{"type":"string","format":"uri","description":"A reference image URL for image generation, or source image URL for image editing."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Up to 9 reference image URLs (or uploaded files)."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"luma/uni-1, luma/uni-1-max"},{"type":"object","properties":{"model":{"type":"string","enum":["magic/image-to-3d"]},"front_image_url":{"type":"string","format":"uri","description":"An image (supplied via URL or Base64) that represents the front view of the object."},"left_image_url":{"type":"string","format":"uri","description":"An image (supplied via URL or Base64) that represents the left-side view of the object."},"back_image_url":{"type":"string","format":"uri","description":"An image (supplied via URL or Base64) that represents the back view of the object."},"right_image_url":{"type":"string","format":"uri","description":"An image (supplied via URL or Base64) that represents the right-side view of the object."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","front_image_url"],"title":"magic/image-to-3d"},{"type":"object","properties":{"model":{"type":"string","enum":["flux/dev"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux/dev"},{"type":"object","properties":{"model":{"type":"string","enum":["flux/schnell"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":64,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":64,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"num_inference_steps":{"type":"integer","minimum":1,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux/schnell"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-pro"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":256,"maximum":1440,"default":1024},"height":{"type":"integer","minimum":256,"maximum":1440,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-pro/v1.1","blackforestlabs/flux-pro-1.1"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":256,"maximum":1440,"default":1024},"height":{"type":"integer","minimum":256,"maximum":1440,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-pro/v1.1, blackforestlabs/flux-pro-1.1"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-pro/v1.1-ultra","blackforestlabs/flux-pro-1.1-ultra"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"raw":{"type":"boolean","enum":[false],"default":false,"description":"Generate less processed, more natural-looking images."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-pro/v1.1-ultra, blackforestlabs/flux-pro-1.1-ultra"},{"type":"object","properties":{"model":{"type":"string","enum":["flux/dev/image-to-image"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"strength":{"type":"number","default":0.95,"description":"Determines how much the prompt influences the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"flux/dev/image-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["flux/srpo"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":28,"description":"The number of inference steps to perform."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"default":4.5,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux/srpo"},{"type":"object","properties":{"model":{"type":"string","enum":["flux/srpo/image-to-image"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":40,"description":"The number of inference steps to perform."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"default":4.5,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"strength":{"type":"number","minimum":0,"maximum":1,"default":0.95,"description":"Determines how much the prompt influences the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"flux/srpo/image-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-pro/kontext/text-to-image","flux-pro/kontext/max/text-to-image","flux/kontext-max/text-to-image","flux/kontext-pro/text-to-image"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-pro/kontext/text-to-image, flux-pro/kontext/max/text-to-image, flux/kontext-max/text-to-image, flux/kontext-pro/text-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-pro/kontext","flux-pro/kontext/max","flux/kontext-max/image-to-image","flux/kontext-pro/image-to-image"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"Number of image variations to generate. Each image is a different attempt to combine the reference images (from the image_url parameter) according to the prompt."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4}],"description":"One or more image URLs used as visual references. The model merges them into a single image following the prompt instructions."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"flux-pro/kontext, flux-pro/kontext/max, flux/kontext-max/image-to-image, flux/kontext-pro/image-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-realism"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-realism"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2","blackforestlabs/flux-2"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":0,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50,"description":"The number of inference steps to perform."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-2, blackforestlabs/flux-2"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2/edit","blackforestlabs/flux-2-edit"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"guidance_scale":{"type":"number","minimum":0,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50,"description":"The number of inference steps to perform."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"flux-2/edit, blackforestlabs/flux-2-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2/lora","blackforestlabs/flux-2-lora"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":0,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50,"description":"The number of inference steps to perform."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"loras":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"URL, HuggingFace repo ID (owner/repo)."},"scale":{"type":"number","minimum":0,"maximum":4,"description":"Scale factor for LoRA application."}},"required":["path"]},"maxItems":3,"description":"List of LoRA weights to apply (maximum 3). Each LoRA can be a URL, HuggingFace repo ID, or local path."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-2/lora, blackforestlabs/flux-2-lora"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2/lora/edit","blackforestlabs/flux-2-lora-edit"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"guidance_scale":{"type":"number","minimum":0,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50,"description":"The number of inference steps to perform."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"loras":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"URL, HuggingFace repo ID (owner/repo)."},"scale":{"type":"number","minimum":0,"maximum":4,"description":"Scale factor for LoRA application."}},"required":["path"]},"maxItems":3,"description":"List of LoRA weights to apply (maximum 3). Each LoRA can be a URL, HuggingFace repo ID, or local path."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"flux-2/lora/edit, blackforestlabs/flux-2-lora-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2-pro/edit","blackforestlabs/flux-2-pro-edit"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"flux-2-pro/edit, blackforestlabs/flux-2-pro-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2-max"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"flux-2-max"},{"type":"object","properties":{"model":{"type":"string","enum":["flux-2-max/edit","blackforestlabs/flux-2-max-edit"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"flux-2-max/edit, blackforestlabs/flux-2-max-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["stable-diffusion-v3-medium"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":64,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":64,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"square_hd"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated image."},"prompt_expansion":{"type":"boolean","description":"If set to True, prompt will be upsampled with more details."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"stable-diffusion-v3-medium"},{"type":"object","properties":{"model":{"type":"string","enum":["stable-diffusion-v35-large"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":64,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":64,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"square_hd"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated image."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"stable-diffusion-v35-large"},{"type":"object","properties":{"model":{"type":"string","enum":["uso","bytedance/uso"]},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"An array of up to 3 image URLs. The first image is always treated as the primary input for image-to-image generation, while the remaining images (if provided) serve as visual style references for the output."},"image_size":{"anyOf":[{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},{"type":"object","properties":{"width":{"type":"number"},"height":{"type":"number"}},"required":["width","height"]}],"default":"square_hd","description":"The size of the generated image."},"negative_prompt":{"type":"string","default":"","description":"The description of elements to avoid in the generated image."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":28,"description":"The number of inference steps to perform."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"default":4,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"keep_size":{"type":"boolean"},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"png","description":"The format of the generated image."},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_urls","prompt"],"title":"uso, bytedance/uso"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedream/v4/edit","bytedance/seedream-v4-edit"]},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},{"type":"object","properties":{"width":{"type":"number","minimum":1024,"maximum":4096},"height":{"type":"number","minimum":1024,"maximum":4096}},"required":["width","height"]}],"default":"square_hd","description":"The size of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_urls","prompt"],"title":"bytedance/seedream/v4/edit, bytedance/seedream-v4-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedream/v4/text-to-image","bytedance/seedream-v4-text-to-image"]},"image_size":{"anyOf":[{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},{"type":"object","properties":{"width":{"type":"number","minimum":1024,"maximum":4096},"height":{"type":"number","minimum":1024,"maximum":4096}},"required":["width","height"]}],"default":"square_hd","description":"The size of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/seedream/v4/text-to-image, bytedance/seedream-v4-text-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["hunyuan-image/v3/text-to-image","hunyuan/hunyuan-image-v3-text-to-image"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated image."},"image_size":{"anyOf":[{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},{"type":"object","properties":{"width":{"type":"number"},"height":{"type":"number"}},"required":["width","height"]}],"default":"square_hd","description":"The size of the generated image."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":28,"description":"The number of inference steps to perform."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"default":7.5,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"sync_mode":{"type":"boolean","default":false,"description":"If set to true, the function will wait for the image to be generated and uploaded before returning the response. This will increase the latency of the function but it allows you to get the image directly in the response without going through the CDN."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","description":"If set to True, prompt will be upsampled with more details."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"hunyuan-image/v3/text-to-image, hunyuan/hunyuan-image-v3-text-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["recraft-v3"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":64,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":64,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"square_hd"},"style":{"type":"string","enum":["any","realistic_image","digital_illustration","vector_illustration","realistic_image/b_and_w","realistic_image/hard_flash","realistic_image/hdr","realistic_image/natural_light","realistic_image/studio_portrait","realistic_image/enterprise","realistic_image/motion_blur","digital_illustration/pixel_art","digital_illustration/hand_drawn","digital_illustration/grain","digital_illustration/infantile_sketch","digital_illustration/2d_art_poster","digital_illustration/handmade_3d","digital_illustration/hand_drawn_outline","digital_illustration/engraving_color","digital_illustration/2d_art_poster_2","vector_illustration/engraving","vector_illustration/line_art","vector_illustration/line_circuit","vector_illustration/linocut"],"default":"realistic_image","description":"The style of the generated images."},"colors":{"type":"array","items":{"type":"object","properties":{"r":{"type":"integer","minimum":0,"maximum":255},"g":{"type":"integer","minimum":0,"maximum":255},"b":{"type":"integer","minimum":0,"maximum":255}},"required":["r","g","b"]},"default":[],"description":"An array of preferred colors."},"num_images":{"type":"number","enum":[1],"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"recraft-v3"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-25-flash-image","google/gemini-2.5-flash-image","gemini-2.5-flash-image"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"aspect_ratio":{"type":"string","enum":["21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"default":"1:1","description":"The aspect ratio of the generated image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-25-flash-image, google/gemini-2.5-flash-image, gemini-2.5-flash-image"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-3-pro-image-preview","google/gemini-3-pro-image","gemini-3-pro-image"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"aspect_ratio":{"type":"string","enum":["21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"default":"1:1","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The size of the generated image."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-3-pro-image-preview, google/gemini-3-pro-image, gemini-3-pro-image"},{"type":"object","properties":{"model":{"type":"string","enum":["nano-banana-2","google/gemini-3.1-flash-image","gemini-3.1-flash-image","google/gemini-3-1-flash-image-preview","google/nano-banana-2"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of URLs or local Base64 encoded images to edit."},"aspect_ratio":{"type":"string","enum":["auto","21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"default":"auto","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K","description":"The size of the generated image."},"enable_web_search":{"type":"boolean","default":false,"description":"Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"nano-banana-2, google/gemini-3.1-flash-image, gemini-3.1-flash-image, google/gemini-3-1-flash-image-preview, google/nano-banana-2"},{"type":"object","properties":{"model":{"type":"string","enum":["hunyuan-part","tencent/hunyuan-part"]},"mesh_url":{"type":"string","format":"uri","description":"URL of the 3D model file (.glb or .obj) to process for segmentation."},"point_prompt_x":{"type":"number","minimum":-1,"maximum":1,"description":"X coordinate of the point prompt for segmentation."},"point_prompt_y":{"type":"number","minimum":-1,"maximum":1,"description":"Y coordinate of the point prompt for segmentation."},"point_prompt_z":{"type":"number","minimum":-1,"maximum":1,"description":"Z coordinate of the point prompt for segmentation."},"point_num":{"type":"integer","default":100000,"description":"Number of points to sample from the mesh."},"use_normal":{"type":"boolean","default":true,"description":"Whether to use normal information for segmentation."},"noise_std":{"type":"number","description":"Standard deviation of noise to add to sampled points."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","mesh_url"],"title":"hunyuan-part, tencent/hunyuan-part"},{"type":"object","properties":{"model":{"type":"string","enum":["meshy/v6/image-to-3d","meshy/meshy-6-image-to-3d"]},"image_url":{"type":"string","format":"uri","description":"The image (URL or Base64 data URI) to build the 3D model from. Supported formats: JPG, JPEG, PNG, AVIF, HEIF."},"model_type":{"type":"string","enum":["standard","lowpoly","smart-topology"],"default":"standard","description":"Mesh generation mode. 'standard' produces a regular high-detail mesh, 'lowpoly' produces a clean low-poly mesh (the remesh controls topology, target_polycount and should_remesh are ignored in this mode), 'smart-topology' produces clean, natively separated parts."},"topology":{"type":"string","enum":["triangle","quad"],"default":"triangle","description":"Topology of the generated mesh: quad for smooth surfaces, triangle for detailed geometry."},"target_polycount":{"type":"integer","minimum":100,"maximum":300000,"description":"Target number of polygons in the generated mesh, from 100 to 300,000 (at most 15,000 for 'smart-topology'). The actual count may deviate from the target. When omitted, 30,000 is used for 'standard' and 4,000 for 'smart-topology'. Ignored for 'lowpoly'."},"symmetry_mode":{"type":"string","enum":["off","auto","on"],"default":"auto","description":"Symmetry during generation: off disables it, auto detects it, on enforces it."},"should_remesh":{"type":"boolean","default":true,"description":"Whether to run the remesh phase."},"should_texture":{"type":"boolean","default":true,"description":"Whether to generate textures."},"enable_pbr":{"type":"boolean","default":false,"description":"Whether to generate PBR maps (metallic, roughness, normal) in addition to the base color."},"pose_mode":{"type":"string","enum":["a-pose","t-pose",""],"default":"","description":"Pose of the generated model: 'a-pose', 't-pose', or an empty string for no specific pose."},"texture_prompt":{"type":"string","maxLength":600,"description":"Text prompt that guides texturing, up to 600 characters."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"meshy/v6/image-to-3d, meshy/meshy-6-image-to-3d"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-pro","flux-2-pro","blackforestlabs/flux-2-pro-preview"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8,"description":"Input image URL(s) for image-to-image / multi-reference editing. Omit for text-to-image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-pro, flux-2-pro, blackforestlabs/flux-2-pro-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-pro","flux-2-pro"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"List of URLs or local Base64 encoded images to edit."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-pro, flux-2-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-max"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8,"description":"Input image URL(s) for image-to-image / multi-reference editing. Omit for text-to-image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-max"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-max"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"description":"List of URLs or local Base64 encoded images to edit."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-max"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-flex"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"If set to True, prompt will be upsampled with more details."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":0,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50,"description":"The number of inference steps to perform."},"acceleration":{"type":"string","enum":["none","regular","high"],"default":"regular","description":"The speed of the generation. The higher the speed, the faster the generation."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8,"description":"Input image URL(s) for image-to-image / multi-reference editing. Omit for text-to-image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-flex"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-2-klein-9b","blackforestlabs/flux-2-klein-9b-preview","blackforestlabs/flux-2-klein-4b"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":2048,"default":1024},"height":{"type":"integer","minimum":512,"maximum":2048,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"output_format":{"type":"string","enum":["jpeg","png","webp"],"default":"png","description":"The format of the generated image."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8,"description":"Input image URL(s) for image-to-image / multi-reference editing. Omit for text-to-image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-2-klein-9b, blackforestlabs/flux-2-klein-9b-preview, blackforestlabs/flux-2-klein-4b"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-outpainting"]},"image_url":{"type":"string","format":"uri","description":"The source image URL."},"width":{"type":"integer","minimum":64,"description":"The output image width in pixels."},"height":{"type":"integer","minimum":64,"description":"The output image height in pixels."},"auto_crop":{"type":"boolean","default":false,"description":"Whether to crop the source image automatically."},"mode":{"type":"string","enum":["high","fast"],"default":"high","description":"The outpainting quality mode."},"prompt":{"type":"string","description":"The optional text prompt used to guide generation."},"reference_offset_x":{"type":"integer","description":"The horizontal reference image offset in pixels."},"reference_offset_y":{"type":"integer","description":"The vertical reference image offset in pixels."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"png","description":"The generated image output format."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","width","height"],"title":"blackforestlabs/flux-outpainting"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-erase"]},"image_url":{"type":"string","format":"uri","description":"The source image URL."},"mask_url":{"type":"string","format":"uri","description":"The mask image URL."},"dilate_pixels":{"type":"integer","minimum":0,"maximum":25,"default":10,"description":"The number of pixels used to dilate the mask."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"png","description":"The generated image output format."},"seed":{"type":"integer","minimum":1,"description":"The random seed used for generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","mask_url"],"title":"blackforestlabs/flux-erase"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-vto"]},"prompt":{"type":"string","description":"The text prompt used to guide generation."},"person_image_url":{"type":"string","format":"uri","description":"The person image URL."},"garment_image_url":{"type":"string","format":"uri","description":"The garment image URL."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5"],"default":"2","description":"The safety tolerance level."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The generated image output format."},"seed":{"type":"integer","minimum":1,"description":"The random seed used for generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","person_image_url","garment_image_url"],"title":"blackforestlabs/flux-vto"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-kontext-pro","blackforestlabs/flux-kontext-max"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4,"description":"Input image URL(s) for image-to-image / multi-reference editing. Omit for text-to-image."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-kontext-pro, blackforestlabs/flux-kontext-max"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-kontext-pro","blackforestlabs/flux-kontext-max"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4}],"description":"One or more image URLs used as visual references. The model merges them into a single image following the prompt instructions."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-kontext-pro, blackforestlabs/flux-kontext-max"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-pro-1.1"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":256,"maximum":1440,"default":1024},"height":{"type":"integer","minimum":256,"maximum":1440,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-pro-1.1"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-pro-1.1-ultra"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"raw":{"type":"boolean","enum":[false],"default":false,"description":"Generate less processed, more natural-looking images."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-pro-1.1-ultra"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-dev"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-dev"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-dev"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"The number of images to generate."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":512,"maximum":1536,"default":1024},"height":{"type":"integer","minimum":512,"maximum":1536,"default":768}},"description":"For both height and width, the value must be a multiple of 32."},{"type":"string","enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"description":"The size of the generated image."}],"default":"landscape_4_3"},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50,"default":50,"description":"The number of inference steps to perform."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to True, the safety checker will be enabled."},"image_url":{"type":"string","format":"uri","description":"The URL of the reference image."},"strength":{"type":"number","default":0.95,"description":"Determines how much the prompt influences the generated image."},"provider":{"type":"string","description":"Provider routing override. `blackforestlabs` runs native BFL with no fallback; `fal` runs the fal.ai fallback; `auto` (default) uses the BFL -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-dev"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-fill"]},"image_url":{"type":"string","format":"uri","description":"The source image URL."},"mask_url":{"type":"string","format":"uri","description":"The optional mask image URL."},"prompt":{"type":"string","default":"","description":"The text prompt used to guide generation."},"num_inference_steps":{"type":"integer","default":50,"description":"The number of inference steps."},"guidance_scale":{"type":"number","default":60,"description":"The prompt guidance scale."},"enable_prompt_expansion":{"type":"boolean","default":false,"description":"Whether to enhance the prompt automatically."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The generated image output format."},"seed":{"type":"integer","minimum":1,"description":"The random seed used for generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"blackforestlabs/flux-fill"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-expand"]},"image_url":{"type":"string","format":"uri","description":"The source image URL."},"top":{"type":"integer","default":0,"description":"The number of pixels to expand above the image."},"bottom":{"type":"integer","default":0,"description":"The number of pixels to expand below the image."},"left":{"type":"integer","default":0,"description":"The number of pixels to expand left of the image."},"right":{"type":"integer","default":0,"description":"The number of pixels to expand right of the image."},"prompt":{"type":"string","default":"","description":"The text prompt used to guide generation."},"num_inference_steps":{"type":"integer","default":50,"description":"The number of inference steps."},"guidance_scale":{"type":"number","default":60,"description":"The prompt guidance scale."},"enable_prompt_expansion":{"type":"boolean","default":false,"description":"Whether to enhance the prompt automatically."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The generated image output format."},"seed":{"type":"integer","minimum":1,"description":"The random seed used for generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"blackforestlabs/flux-expand"},{"type":"object","properties":{"model":{"type":"string","enum":["beeble/switchx-image-to-image","switchx-image-to-image"]},"image_url":{"type":"string","format":"uri","description":"URL of the source image to recomposite. Allowed formats: JPEG, PNG, WEBP. Source must not exceed 2,770,000 total pixels."},"alpha_url":{"type":"string","format":"uri","description":"URL of the alpha mask. Required when alpha_mode is \"custom\" or \"select\"; ignored for \"auto\" and \"fill\". A mask video for video-to-video, a mask image for image-to-image."},"reference_image_url":{"type":"string","format":"uri","description":"URL of the reference image defining the target look and lighting for the replaced region. Allowed formats: JPEG, PNG, WEBP. At least one of reference_image_url or prompt must be provided."},"alpha_mode":{"type":"string","enum":["auto","fill","custom","select"],"default":"auto","description":"Subject masking strategy: \"auto\" (AI auto-detects the subject), \"fill\" (no masking), \"select\" (propagate a mask from one keyframe), or \"custom\" (frame-by-frame mask supplied via alpha_url). Defaults to \"auto\"."},"max_resolution":{"type":"integer","description":"Maximum output resolution (longer side) in pixels: 720 or 1080. Defaults to 1080. 1080 costs more than 720.","enum":[720,1080],"default":"1080"},"alpha_keyframe_index":{"type":"integer","minimum":0,"description":"Frame index (0-based) whose mask is propagated when alpha_mode is \"select\" on a video. Defaults to the first frame. Ignored for image generation and for the auto, fill, and custom modes."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Random seed (0–4294967295) for reproducibility. Omit for a random seed. The seed used is always returned in the response."},"prompt":{"type":"string","maxLength":2000,"description":"Text description of the desired output to guide the generation (max 2000 characters). At least one of prompt or reference_image_url must be provided."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"beeble/switchx-image-to-image, switchx-image-to-image"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"n":{"type":"number","enum":[1],"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":14,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":1440,"maximum":4096,"default":2048},"height":{"type":"integer","minimum":1440,"maximum":4096,"default":2048}}},{"type":"string","enum":["2K","4K"]}],"description":"The size of the generated image."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"default":"16:9","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"Number of image variations to generate. Each image is a different attempt to combine the reference images (from the image_url parameter) according to the prompt."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4}],"description":"One or more image URLs used as visual references. The model merges them into a single image following the prompt instructions."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"n":{"type":"number","enum":[1],"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":14,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":1440,"maximum":4096,"default":2048},"height":{"type":"integer","minimum":1440,"maximum":4096,"default":2048}}},{"type":"string","enum":["2K","4K"]}],"description":"The size of the generated image."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"default":"16:9","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"Number of image variations to generate. Each image is a different attempt to combine the reference images (from the image_url parameter) according to the prompt."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4}],"description":"One or more image URLs used as visual references. The model merges them into a single image following the prompt instructions."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"n":{"type":"number","enum":[1],"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":14,"description":"List of URLs or local Base64 encoded images to edit."},"image_size":{"anyOf":[{"type":"object","properties":{"width":{"type":"integer","minimum":1440,"maximum":4096,"default":2048},"height":{"type":"integer","minimum":1440,"maximum":4096,"default":2048}}},{"type":"string","enum":["2K","4K"]}],"description":"The size of the generated image."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"seed":{"type":"integer","description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"watermark":{"type":"boolean","default":false,"description":"Add an invisible watermark to the generated images."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"default":"16:9","description":"The aspect ratio of the generated image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","maxLength":4000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"num_images":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"Number of image variations to generate. Each image is a different attempt to combine the reference images (from the image_url parameter) according to the prompt."},"seed":{"type":"integer","minimum":1,"description":"The same seed and the same prompt given to the same version of the model will output the same image every time."},"guidance_scale":{"type":"number","minimum":1,"maximum":20,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you."},"safety_tolerance":{"type":"string","enum":["1","2","3","4","5","6"],"default":"2","description":"The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."},"output_format":{"type":"string","enum":["jpeg","png"],"default":"jpeg","description":"The format of the generated image."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","3:2","1:1","2:3","3:4","9:16","9:21"],"default":"16:9","description":"The aspect ratio of the generated image."},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4}],"description":"One or more image URLs used as visual references. The model merges them into a single image following the prompt instructions."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","nullable":true,"description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"},"b64_json":{"type":"string","nullable":true,"description":"The base64-encoded JSON of the generated image.","example":null}}},"description":"The list of generated images."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]},"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}}}}}}},"/v1/images/edits":{"post":{"operationId":"_v1_images_edits","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-image-1-mini","openai/gpt-image-1-mini","gpt-image-1.5","openai/gpt-image-1.5","gpt-image-2","openai/gpt-image-2","gpt-image-2.5-sunburst","openai/gpt-image-2.5-sunburst","gpt-image-2.5-flare","openai/gpt-image-2.5-flare","openai/gpt-image-1-5"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"maxItems":16}],"description":"The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"mask":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","nullable":true,"minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."}},"required":["model","prompt","image"],"title":"gpt-image-1-mini, openai/gpt-image-1-mini, gpt-image-1.5, openai/gpt-image-1.5, gpt-image-2, openai/gpt-image-2, gpt-image-2.5-sunburst, openai/gpt-image-2.5-sunburst, gpt-image-2.5-flare, openai/gpt-image-2.5-flare, openai/gpt-image-1-5"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-image-2.6-sunburst","openai/gpt-image-2.6-sunburst","gpt-image-2.6-flare","openai/gpt-image-2.6-flare"]},"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":16}],"description":"The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."},"mask":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image."},"markup":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"Transparent PNG with circles, arrows or notes over the first image, the same size as that image; describe the change in prompt. Not with mask."},"size":{"type":"string","description":"Size of each image as WIDTHxHEIGHT, or auto. Width and height are multiples of 16, the aspect ratio is between 1:3 and 3:1, no edge exceeds 3840 pixels and the image has at most 8,294,400 pixels (at least 655,360 except for GIF frames). For GIF output, the size of one frame. Defaults to 1024x1024, or to auto for GIF output.","example":"1536x1024"},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"],"default":"medium","description":"Rendering quality. xhigh and max cost more output tokens; auto lets the model choose."},"complexity":{"type":"string","enum":["low","medium","high"],"default":"high","description":"How much the model plans the image before rendering, independently of quality. Higher complexity helps dense text and complex layouts and can add latency."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Background of the image. transparent needs output_format png or webp."},"moderation":{"type":"string","enum":["low","auto"],"default":"auto","description":"Control the content-moderation level for images."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"Number of images to generate, from 1 to 10."},"frame_count":{"type":"integer","minimum":2,"maximum":16,"description":"Number of GIF frames, from 2 to 16. Only with output_format gif. Defaults to 9."},"frame_duration_ms":{"type":"integer","minimum":20,"maximum":655350,"description":"Delay per GIF frame in milliseconds, rounded to 10 ms. Only with output_format gif. Defaults to 200."},"output_compression":{"type":"integer","nullable":true,"minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"output_format":{"type":"string","enum":["png","jpeg","webp","gif"],"default":"png","description":"Output format. gif returns an animation (see frame_count)."}},"required":["model","prompt","image"],"title":"gpt-image-2.6-sunburst, openai/gpt-image-2.6-sunburst, gpt-image-2.6-flare, openai/gpt-image-2.6-flare"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-imagine-image","grok-imagine-image-2026-03-02","x-ai/grok-imagine-image-pro"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":5}],"description":"The image(s) to edit: one PNG, JPEG or WebP file, or an array of up to 5. Refer to several images in the prompt as <IMAGE_0>, <IMAGE_1>, … in upload order."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"description":"The aspect ratio of the edited image. When omitted, the output keeps the aspect ratio of the first input image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."}},"required":["model","prompt","image"],"title":"x-ai/grok-imagine-image, grok-imagine-image-2026-03-02, x-ai/grok-imagine-image-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["x-ai/grok-imagine-image-2.0","grok-imagine-image-2.0"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":5}],"description":"The image(s) to edit: one PNG, JPEG or WebP file, or an array of up to 5. Refer to several images in the prompt as <IMAGE_0>, <IMAGE_1>, … in upload order."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","21:9","5:2","auto"],"description":"The aspect ratio of the edited image. When omitted, the output keeps the aspect ratio of the first input image."},"resolution":{"type":"string","enum":["1k","1.5k","2k"],"default":"1k","description":"The resolution of the output image. A higher resolution costs more."},"quality":{"type":"string","enum":["low","medium"],"default":"low","description":"The quality of the image that will be generated. `medium` renders more detail and costs more than `low` at the same resolution."}},"required":["model","prompt","image"],"title":"x-ai/grok-imagine-image-2.0, grok-imagine-image-2.0"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"maxItems":16}],"description":"The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"mask":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","nullable":true,"minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":5}],"description":"The image(s) to edit: one PNG, JPEG or WebP file, or an array of up to 5. Refer to several images in the prompt as <IMAGE_0>, <IMAGE_1>, … in upload order."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"description":"The aspect ratio of the edited image. When omitted, the output keeps the aspect ratio of the first input image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"maxItems":16}],"description":"The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"mask":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","nullable":true,"minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":5}],"description":"The image(s) to edit: one PNG, JPEG or WebP file, or an array of up to 5. Refer to several images in the prompt as <IMAGE_0>, <IMAGE_1>, … in upload order."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"description":"The aspect ratio of the edited image. When omitted, the output keeps the aspect ratio of the first input image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","maxLength":32000,"description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"maxItems":16}],"description":"The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"],"default":"1024x1024","description":"The size of the generated image."},"quality":{"type":"string","enum":["low","high","medium"],"default":"medium","description":"The quality of the image that will be generated."},"output_format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"The format of the generated image."},"mask":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"],"description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image."},"background":{"type":"string","enum":["transparent","opaque","auto"],"default":"auto","description":"Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."},"n":{"type":"number","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"output_compression":{"type":"integer","nullable":true,"minimum":0,"maximum":100,"default":100,"description":"Compression level (0-100%), applies to JPEG and WebP only."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","description":"The text prompt describing the content, style, or composition of the image to be generated."},"image":{"anyOf":[{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},{"type":"array","items":{"type":"object","properties":{"buffer":{"nullable":true},"mimetype":{"type":"string"},"size":{"type":"integer"},"originalname":{"type":"string"},"encoding":{"type":"string"},"fieldname":{"type":"string"}},"required":["mimetype","originalname","encoding","fieldname"]},"minItems":1,"maxItems":5}],"description":"The image(s) to edit: one PNG, JPEG or WebP file, or an array of up to 5. Refer to several images in the prompt as <IMAGE_0>, <IMAGE_1>, … in upload order."},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate."},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"The format in which the generated images are returned."},"aspect_ratio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9","2:3","3:2","9:19.5","19.5:9","9:20","20:9","1:2","2:1","auto"],"description":"The aspect ratio of the edited image. When omitted, the output keeps the aspect ratio of the first input image."},"resolution":{"type":"string","enum":["1k","2k"],"default":"2k","description":"The resolution of the output image."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","prompt","image"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","nullable":true,"description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"},"b64_json":{"type":"string","nullable":true,"description":"The base64-encoded JSON of the generated image.","example":null}}},"description":"The list of generated images."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]},"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}}}}}}},"/v1/stt/create":{"post":{"operationId":"_v1_stt_create","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-4o-transcribe","openai/gpt-4o-transcribe","gpt-4o-mini-transcribe","openai/gpt-4o-mini-transcribe"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or file — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"file":{"type":"string","description":"The audio file to transcribe. Provide either url or file — exactly one is required, not both.","format":"binary"},"language":{"type":"string","description":"The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available"},"prompt":{"type":"string","description":"An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language."},"temperature":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"gpt-4o-transcribe, openai/gpt-4o-transcribe, gpt-4o-mini-transcribe, openai/gpt-4o-mini-transcribe"},{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/scribe_v2"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or audio — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"audio":{"type":"string","description":"The audio file to transcribe. Provide either url or audio — exactly one is required, not both.","format":"binary"},"language_code":{"type":"string","description":"The language of the audio as an ISO-639-1 or ISO-639-3 code, for example \"en\" or \"heb\". Omit it to detect the language automatically.","example":"en"},"diarize":{"type":"boolean","description":"Label which speaker says each word (speaker_0, speaker_1, …)."},"num_speakers":{"type":"integer","minimum":1,"maximum":32,"description":"The maximum number of speakers in the audio, from 1 to 32. Helps speaker labelling; by default the model decides."},"timestamps_granularity":{"type":"string","enum":["none","word","character"],"description":"Timing detail in the answer: \"word\" (the default) or \"character\" timings for every word, or \"none\"."},"tag_audio_events":{"type":"boolean","description":"Tag non-speech sounds such as (laughter) or (applause) in the transcript. On by default."},"no_verbatim":{"type":"boolean","description":"Leave out filler words, false starts and non-speech sounds."},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2,"description":"Randomness of the transcription, from 0 to 2. By default the model picks it (usually 0)."},"seed":{"type":"integer","nullable":true,"minimum":0,"maximum":2147483647,"description":"Best-effort deterministic sampling: repeated requests with the same seed and parameters should return the same transcript."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"elevenlabs/scribe_v2"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-3.5-transcribe","google/gemini-3.5-transcribe"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or audio — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"audio":{"type":"string","description":"The audio file to transcribe. Provide either url or audio — exactly one is required, not both. Up to 20 MB.","format":"binary"},"language_codes":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100,"description":"BCP-47 codes of the languages spoken in the audio, for example [\"he-IL\"] or [\"en-US\", \"es-ES\"]. Omit them to detect the language automatically (85+ languages, mixed-language speech included).","example":["en-US"]},"custom_vocabulary":{"type":"array","items":{"type":"string","minLength":1},"maxItems":1000,"description":"Up to 1,000 names, acronyms or terms to bias recognition toward (best results with up to 100). Cannot be combined with diarization or word_timestamps.","example":["Gemini","BigQuery"]},"diarization":{"type":"boolean","description":"Split the transcript into speaker turns labelled spk_1, spk_2, … (up to 8 speakers; 3 or more is experimental). Audio is then limited to 30 minutes."},"word_timestamps":{"type":"boolean","description":"Return start and end times for every word. May lower accuracy; audio is then limited to 30 minutes."},"mode":{"type":"string","enum":["verbatim","smart"],"description":"\"verbatim\" (the default) keeps every spoken word, fillers included. \"smart\" removes fillers and false starts, applies self-corrections and formats lists, numbers and dates; it cannot be combined with diarization or word_timestamps."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"gemini-3.5-transcribe, google/gemini-3.5-transcribe"},{"type":"object","properties":{"model":{"type":"string","enum":["nova-2-general","deepgram/nova-2-general","#g1_nova-2-general","nova-2-meeting","deepgram/nova-2-meeting","#g1_nova-2-meeting","nova-2-phonecall","deepgram/nova-2-phonecall","#g1_nova-2-phonecall","nova-2-voicemail","deepgram/nova-2-voicemail","#g1_nova-2-voicemail","nova-2-finance","deepgram/nova-2-finance","#g1_nova-2-finance","nova-2-conversationalai","deepgram/nova-2-conversationalai","#g1_nova-2-conversationalai","nova-2-video","deepgram/nova-2-video","#g1_nova-2-video","nova-2-medical","deepgram/nova-2-medical","#g1_nova-2-medical","nova-2-drivethru","deepgram/nova-2-drivethru","#g1_nova-2-drivethru","nova-2-automotive","deepgram/nova-2-automotive","#g1_nova-2-automotive","whisper-large","deepgram/whisper-large","#g1_whisper-large","whisper-medium","deepgram/whisper-medium","#g1_whisper-medium","whisper-small","deepgram/whisper-small","#g1_whisper-small","whisper-tiny","deepgram/whisper-tiny","#g1_whisper-tiny","whisper-base","deepgram/whisper-base","#g1_whisper-base"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or audio — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"audio":{"type":"string","description":"The audio file to transcribe. Provide either url or audio — exactly one is required, not both.","format":"binary"},"custom_intent":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"A custom intent you want the model to detect within your input audio if present. Submit up to 100."},"custom_topic":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"A custom topic you want the model to detect within your input audio if present. Submit up to 100."},"custom_intent_mode":{"type":"string","enum":["strict","extended"],"description":"Sets how the model will interpret strings submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param."},"custom_topic_mode":{"type":"string","enum":["strict","extended"],"description":"Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param."},"detect_language":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"}],"description":"Enables language detection to identify the dominant language spoken in the submitted audio."},"detect_entities":{"type":"boolean","description":"When Entity Detection is enabled, the Punctuation feature will be enabled by default."},"diarize":{"type":"boolean","description":"Recognizes speaker changes. Each word in the transcript will be assigned a speaker number starting at 0."},"dictation":{"type":"boolean","description":"Identifies and extracts key entities from content in submitted audio."},"encoding":{"type":"string","enum":["linear16","flac","mulaw","amr-nb","amr-wb","opus","speex","g729"],"description":"Expected encoding of the submitted audio (used mainly for raw audio). One of: linear16, flac, mulaw, amr-nb, amr-wb, opus, speex, g729."},"extra":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Arbitrary key-value pairs that are attached to the API response for usage in downstream processing."},"filler_words":{"type":"boolean","description":"Filler Words can help transcribe interruptions in your audio, like “uh” and “um”."},"intents":{"type":"boolean","description":"Recognizes speaker intent throughout a transcript or text."},"language":{"type":"string","description":"The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available"},"measurements":{"type":"boolean","description":"Spoken measurements will be converted to their corresponding abbreviations"},"mip_opt_out":{"type":"boolean","description":"Opt out of the Deepgram Model Improvement Program for this request."},"multichannel":{"type":"boolean","description":"Enable Multichannel transcription, can be true or false."},"numerals":{"type":"boolean","description":"Numerals converts numbers from written format to numerical format"},"paragraphs":{"type":"boolean","description":"Splits audio into paragraphs to improve transcript readability"},"profanity_filter":{"type":"boolean","description":"Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely"},"punctuate":{"type":"boolean","description":"Adds punctuation and capitalization to the transcript"},"redact":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Redact sensitive information from the transcript. Common values: pii, pci, numbers. Pass a single value or an array."},"replace":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Search for terms and replace them in the transcript. Provide \"find:replace\" pairs as a single value or an array."},"search":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Search for terms or phrases in submitted audio"},"sentiment":{"type":"boolean","description":"Recognizes the sentiment throughout a transcript or text"},"smart_format":{"type":"boolean","description":"Applies formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability"},"summarize":{"anyOf":[{"type":"string"},{"type":"boolean"}],"description":"Summarizes content. For Listen API, supports string version option. For Read API, accepts boolean only."},"tag":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Labels your requests for the purpose of identification during usage reporting"},"topics":{"type":"boolean","description":"Detects topics throughout a transcript or text"},"utterances":{"type":"boolean","description":"Segments speech into meaningful semantic units"},"utt_split":{"type":"number","description":"Seconds to wait before detecting a pause between words in submitted audio"},"version":{"type":"string","description":"Model version to use (e.g. \"latest\" or a specific version string). Defaults to latest."},"keywords":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Keywords can boost or suppress specialized terminology and brands."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"nova-2-general, deepgram/nova-2-general, #g1_nova-2-general, nova-2-meeting, deepgram/nova-2-meeting, #g1_nova-2-meeting, nova-2-phonecall, deepgram/nova-2-phonecall, #g1_nova-2-phonecall, nova-2-voicemail, deepgram/nova-2-voicemail, #g1_nova-2-voicemail, nova-2-finance, deepgram/nova-2-finance, #g1_nova-2-finance, nova-2-conversationalai, deepgram/nova-2-conversationalai, #g1_nova-2-conversationalai, nova-2-video, deepgram/nova-2-video, #g1_nova-2-video, nova-2-medical, deepgram/nova-2-medical, #g1_nova-2-medical, nova-2-drivethru, deepgram/nova-2-drivethru, #g1_nova-2-drivethru, nova-2-automotive, deepgram/nova-2-automotive, #g1_nova-2-automotive, whisper-large, deepgram/whisper-large, #g1_whisper-large, whisper-medium, deepgram/whisper-medium, #g1_whisper-medium, whisper-small, deepgram/whisper-small, #g1_whisper-small, whisper-tiny, deepgram/whisper-tiny, #g1_whisper-tiny, whisper-base, deepgram/whisper-base, #g1_whisper-base"},{"type":"object","properties":{"model":{"type":"string","enum":["nova-3","deepgram/nova-3","#g1_nova-3","nova-3-general","deepgram/nova-3-general","#g1_nova-3-general","nova-3-medical","deepgram/nova-3-medical","#g1_nova-3-medical"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or audio — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"audio":{"type":"string","description":"The audio file to transcribe. Provide either url or audio — exactly one is required, not both.","format":"binary"},"custom_intent":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"A custom intent you want the model to detect within your input audio if present. Submit up to 100."},"custom_topic":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"A custom topic you want the model to detect within your input audio if present. Submit up to 100."},"custom_intent_mode":{"type":"string","enum":["strict","extended"],"description":"Sets how the model will interpret strings submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param."},"custom_topic_mode":{"type":"string","enum":["strict","extended"],"description":"Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param."},"detect_language":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"}],"description":"Enables language detection to identify the dominant language spoken in the submitted audio."},"detect_entities":{"type":"boolean","description":"When Entity Detection is enabled, the Punctuation feature will be enabled by default."},"diarize":{"type":"boolean","description":"Recognizes speaker changes. Each word in the transcript will be assigned a speaker number starting at 0."},"dictation":{"type":"boolean","description":"Identifies and extracts key entities from content in submitted audio."},"encoding":{"type":"string","enum":["linear16","flac","mulaw","amr-nb","amr-wb","opus","speex","g729"],"description":"Expected encoding of the submitted audio (used mainly for raw audio). One of: linear16, flac, mulaw, amr-nb, amr-wb, opus, speex, g729."},"extra":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Arbitrary key-value pairs that are attached to the API response for usage in downstream processing."},"filler_words":{"type":"boolean","description":"Filler Words can help transcribe interruptions in your audio, like “uh” and “um”."},"intents":{"type":"boolean","description":"Recognizes speaker intent throughout a transcript or text."},"language":{"type":"string","description":"The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available"},"measurements":{"type":"boolean","description":"Spoken measurements will be converted to their corresponding abbreviations"},"mip_opt_out":{"type":"boolean","description":"Opt out of the Deepgram Model Improvement Program for this request."},"multichannel":{"type":"boolean","description":"Enable Multichannel transcription, can be true or false."},"numerals":{"type":"boolean","description":"Numerals converts numbers from written format to numerical format"},"paragraphs":{"type":"boolean","description":"Splits audio into paragraphs to improve transcript readability"},"profanity_filter":{"type":"boolean","description":"Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely"},"punctuate":{"type":"boolean","description":"Adds punctuation and capitalization to the transcript"},"redact":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Redact sensitive information from the transcript. Common values: pii, pci, numbers. Pass a single value or an array."},"replace":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Search for terms and replace them in the transcript. Provide \"find:replace\" pairs as a single value or an array."},"search":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Search for terms or phrases in submitted audio"},"sentiment":{"type":"boolean","description":"Recognizes the sentiment throughout a transcript or text"},"smart_format":{"type":"boolean","description":"Applies formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability"},"summarize":{"anyOf":[{"type":"string"},{"type":"boolean"}],"description":"Summarizes content. For Listen API, supports string version option. For Read API, accepts boolean only."},"tag":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Labels your requests for the purpose of identification during usage reporting"},"topics":{"type":"boolean","description":"Detects topics throughout a transcript or text"},"utterances":{"type":"boolean","description":"Segments speech into meaningful semantic units"},"utt_split":{"type":"number","description":"Seconds to wait before detecting a pause between words in submitted audio"},"version":{"type":"string","description":"Model version to use (e.g. \"latest\" or a specific version string). Defaults to latest."},"keyterm":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Keyterm Prompting (Nova-3 / Flux only): boost recognition of specialized terms, brands, and proper nouns. Pass a single term or an array of terms."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"nova-3, deepgram/nova-3, #g1_nova-3, nova-3-general, deepgram/nova-3-general, #g1_nova-3-general, nova-3-medical, deepgram/nova-3-medical, #g1_nova-3-medical"},{"type":"object","properties":{"model":{"type":"string","enum":["slam-1","aai/slam-1","universal","aai/universal"]},"url":{"type":"string","format":"uri","description":"URL of the input audio file. Provide either url or audio — exactly one is required, not both.","example":"https://example.com/audio/sample.mp3"},"audio":{"type":"string","description":"The audio file to transcribe. Provide either url or audio — exactly one is required, not both.","format":"binary"},"audio_start_from":{"type":"integer","nullable":true,"description":"The point in time, in milliseconds, in the file at which the transcription was started."},"audio_end_at":{"type":"integer","nullable":true,"description":"The point in time, in milliseconds, in the file at which the transcription was terminated."},"language_code":{"type":"string","description":"The language of your audio file. Possible values are found in Supported Languages. The default value is 'en_us'."},"language_confidence_threshold":{"type":"number","nullable":true,"minimum":0,"maximum":1,"description":"The confidence threshold for the automatically detected language. An error will be returned if the language confidence is below this threshold. Defaults to 0."},"language_detection":{"type":"boolean","description":"Enable Automatic language detection, either true or false. Available for universal model only."},"punctuate":{"type":"boolean","nullable":true,"default":null,"description":"Adds punctuation and capitalization to the transcript"},"format_text":{"type":"boolean","default":true,"description":"Enable Text Formatting, can be true or false."},"disfluencies":{"type":"boolean","default":false,"description":"Transcribe Filler Words, like \"umm\", in your media file; can be true or false."},"multichannel":{"type":"boolean","default":false,"description":"Enable Multichannel transcription, can be true or false."},"speaker_labels":{"type":"boolean","nullable":true,"default":null,"description":"Enable Speaker diarization, can be true or false."},"speakers_expected":{"type":"integer","nullable":true,"default":null,"description":"Tell the speaker label model how many speakers it should attempt to identify. See Speaker diarization for more details."},"content_safety":{"type":"boolean","default":false,"description":"Enable Content Moderation, can be true or false."},"iab_categories":{"type":"boolean","default":false,"description":"Enable Topic Detection, can be true or false."},"custom_spelling":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"description":"Customize how words are spelled and formatted using to and from values."},"auto_highlights":{"type":"boolean","default":false,"description":"Enable Key Phrases, either true or false."},"word_boost":{"type":"array","items":{"type":"string"},"description":"The list of custom vocabulary to boost transcription probability for."},"boost_param":{"type":"string","enum":["low","default","high"],"description":"How much to boost specified words. Allowed values: low, default, high."},"filter_profanity":{"type":"boolean","default":false,"description":"Filter profanity from the transcribed text, can be true or false."},"redact_pii":{"type":"boolean","default":false,"description":"Redact PII from the transcribed text using the Redact PII model, can be true or false."},"redact_pii_audio":{"type":"boolean","default":false,"description":"Generate a copy of the original media file with spoken PII \"beeped\" out, can be true or false. See PII redaction for more details."},"redact_pii_audio_quality":{"type":"string","enum":["mp3","wav"],"description":"Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See PII redaction for more details."},"redact_pii_policies":{"type":"array","items":{"type":"string","enum":["account_number","banking_information","blood_type","credit_card_cvv","credit_card_expiration","credit_card_number","date","date_interval","date_of_birth","drivers_license","drug","duration","email_address","event","filename","gender_sexuality","healthcare_number","injury","ip_address","language","location","marital_status","medical_condition","medical_process","money_amount","nationality","number_sequence","occupation","organization","passport_number","password","person_age","person_name","phone_number","physical_attribute","political_affiliation","religion","statistics","time","url","us_social_security_number","username","vehicle_id","zodiac_sign"]},"description":"The list of PII Redaction policies to enable. See PII redaction for more details."},"redact_pii_sub":{"type":"string","enum":["entity_name","hash"],"description":"The replacement logic for detected PII, can be `entity_type` or `hash`. See PII redaction for more details."},"sentiment_analysis":{"type":"boolean","default":false,"description":"Enable Sentiment Analysis, can be true or false."},"entity_detection":{"type":"boolean","default":false,"description":"Enable Entity Detection, can be true or false."},"summarization":{"type":"boolean","default":false,"description":"Enable Summarization, can be true or false."},"summary_model":{"type":"string","enum":["informative","conversational","catchy"],"description":"The model to summarize the transcript. Allowed values: informative, conversational, catchy."},"summary_type":{"type":"string","enum":["bullets","bullets_verbose","gist","headline","paragraph"],"description":"The type of summary. Allowed values: bullets, bullets_verbose, gist, headline, paragraph."},"auto_chapters":{"type":"boolean","default":false,"description":"Enable Auto Chapters, either true or false."},"speech_threshold":{"type":"number","nullable":true,"minimum":0,"maximum":1,"description":"Reject audio files that contain less than this fraction of speech. Valid values are in the range [0, 1] inclusive."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"slam-1, aai/slam-1, universal, aai/universal"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"generation_id":{"type":"string"}},"required":["generation_id"]}}}}}}},"/v1/stt/:generation_id":{"get":{"operationId":"_v1_stt_:generation_id","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["gpt-4o-transcribe","openai/gpt-4o-transcribe","gpt-4o-mini-transcribe","openai/gpt-4o-mini-transcribe","elevenlabs/scribe_v2","gemini-3.5-transcribe","google/gemini-3.5-transcribe","nova-2-general","deepgram/nova-2-general","#g1_nova-2-general","nova-2-meeting","deepgram/nova-2-meeting","#g1_nova-2-meeting","nova-2-phonecall","deepgram/nova-2-phonecall","#g1_nova-2-phonecall","nova-2-voicemail","deepgram/nova-2-voicemail","#g1_nova-2-voicemail","nova-2-finance","deepgram/nova-2-finance","#g1_nova-2-finance","nova-2-conversationalai","deepgram/nova-2-conversationalai","#g1_nova-2-conversationalai","nova-2-video","deepgram/nova-2-video","#g1_nova-2-video","nova-2-medical","deepgram/nova-2-medical","#g1_nova-2-medical","nova-2-drivethru","deepgram/nova-2-drivethru","#g1_nova-2-drivethru","nova-2-automotive","deepgram/nova-2-automotive","#g1_nova-2-automotive","nova-3","deepgram/nova-3","#g1_nova-3","nova-3-general","deepgram/nova-3-general","#g1_nova-3-general","nova-3-medical","deepgram/nova-3-medical","#g1_nova-3-medical","whisper-large","deepgram/whisper-large","#g1_whisper-large","whisper-medium","deepgram/whisper-medium","#g1_whisper-medium","whisper-small","deepgram/whisper-small","#g1_whisper-small","whisper-tiny","deepgram/whisper-tiny","#g1_whisper-tiny","whisper-base","deepgram/whisper-base","#g1_whisper-base","slam-1","aai/slam-1","universal","aai/universal"]},"id":{"type":"string"}},"required":["model","id"],"title":"gpt-4o-transcribe, openai/gpt-4o-transcribe, gpt-4o-mini-transcribe, openai/gpt-4o-mini-transcribe, elevenlabs/scribe_v2, gemini-3.5-transcribe, google/gemini-3.5-transcribe, nova-2-general, deepgram/nova-2-general, #g1_nova-2-general, nova-2-meeting, deepgram/nova-2-meeting, #g1_nova-2-meeting, nova-2-phonecall, deepgram/nova-2-phonecall, #g1_nova-2-phonecall, nova-2-voicemail, deepgram/nova-2-voicemail, #g1_nova-2-voicemail, nova-2-finance, deepgram/nova-2-finance, #g1_nova-2-finance, nova-2-conversationalai, deepgram/nova-2-conversationalai, #g1_nova-2-conversationalai, nova-2-video, deepgram/nova-2-video, #g1_nova-2-video, nova-2-medical, deepgram/nova-2-medical, #g1_nova-2-medical, nova-2-drivethru, deepgram/nova-2-drivethru, #g1_nova-2-drivethru, nova-2-automotive, deepgram/nova-2-automotive, #g1_nova-2-automotive, nova-3, deepgram/nova-3, #g1_nova-3, nova-3-general, deepgram/nova-3-general, #g1_nova-3-general, nova-3-medical, deepgram/nova-3-medical, #g1_nova-3-medical, whisper-large, deepgram/whisper-large, #g1_whisper-large, whisper-medium, deepgram/whisper-medium, #g1_whisper-medium, whisper-small, deepgram/whisper-small, #g1_whisper-small, whisper-tiny, deepgram/whisper-tiny, #g1_whisper-tiny, whisper-base, deepgram/whisper-base, #g1_whisper-base, slam-1, aai/slam-1, universal, aai/universal"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","generating","completed","error"]},"output":{"anyOf":[{"type":"object","properties":{"metadata":{"type":"object","properties":{"transaction_key":{"type":"string","description":"A unique transaction key; currently always “deprecated”."},"request_id":{"type":"string","description":"A UUID identifying this specific transcription request."},"sha256":{"type":"string","description":"The SHA-256 hash of the submitted audio file (for pre-recorded requests)."},"created":{"type":"string","format":"date-time","description":"ISO-8601 timestamp."},"duration":{"type":"number","description":"Length of the audio in seconds."},"channels":{"type":"number","description":"The top-level results object containing per-channel transcription alternatives."},"models":{"type":"array","items":{"type":"string"},"description":"List of model UUIDs used for this transcription"},"model_info":{"type":"object","additionalProperties":{"type":"object","properties":{"name":{"type":"string","description":"The human-readable name of the model — identifies which model was used."},"version":{"type":"string","description":"The specific version of the model."},"arch":{"type":"string","description":"The architecture of the model — describes the model family / generation."}},"required":["name","version","arch"]},"description":"Mapping from each model UUID (in 'models') to detailed info: its name, version, and architecture."}},"required":["transaction_key","request_id","sha256","created","duration","channels","models","model_info"],"description":"Metadata about the transcription response, including timing, models, and IDs."},"results":{"type":"object","nullable":true,"properties":{"channels":{"type":"object","properties":{"alternatives":{"type":"array","items":{"type":"object","properties":{"transcript":{"type":"string","description":"The full transcript text for this alternative."},"confidence":{"type":"number","description":"Overall confidence score (0-1) that assigns to this transcript alternative."},"words":{"type":"array","items":{"type":"object","properties":{"word":{"type":"string","description":"The raw recognized word, without punctuation or capitalization."},"start":{"type":"number","description":"Start timestamp of the word (in seconds, from beginning of audio)."},"end":{"type":"number","description":"End timestamp of the word (in seconds)."},"confidence":{"type":"number","description":"Confidence score (0-1) for this individual word."},"punctuated_word":{"type":"string","description":"The same word but with punctuation/capitalization applied (if smart_format is enabled)."}},"required":["word","start","end","confidence","punctuated_word"]},"description":"List of word-level timing, confidence, and punctuation details."},"paragraphs":{"type":"array","items":{"type":"object","properties":{"transcript":{"type":"string","description":"The transcript split into paragraphs (with line breaks), when paragraphing is enabled."},"paragraphs":{"type":"object","properties":{"sentences":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Text of a single sentence in the paragraph."},"start":{"type":"number","description":"Start time of the sentence (in seconds)."},"end":{"type":"number","description":"End time of the sentence (in seconds)."}},"required":["text","start","end"]},"description":"List of sentences in this paragraph, with start/end times."},"num_words":{"type":"number","description":"Number of words in this paragraph."},"start":{"type":"number","description":"Start time of the paragraph (in seconds)."},"end":{"type":"number","description":"End time of the paragraph (in seconds)."}},"required":["sentences","num_words","start","end"],"description":"Structure describing each paragraph: its timespan, word count, and sentence breakdown."}},"required":["transcript","paragraphs"]},"description":"An array of paragraph objects, present when the paragraphs feature is enabled."}},"required":["transcript","confidence","words","paragraphs"]},"description":"List of possible transcription hypotheses (“alternatives”) for each channel."}},"required":["alternatives"],"description":"The top-level results object containing per-channel transcription alternatives."}},"required":["channels"]}},"required":["metadata"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"language_model":{"type":"string"},"acoustic_model":{"type":"string"},"language_code":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","error"]},"language_detection":{"type":"boolean"},"language_confidence_threshold":{"type":"number"},"language_confidence":{"type":"number"},"speech_model":{"type":"string","enum":["best","slam-1","universal"]},"text":{"type":"string"},"words":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"string"},"start":{"type":"number"},"text":{"type":"string"}},"required":["confidence","end","start","text"]}},"utterances":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"string"},"start":{"type":"number"},"text":{"type":"string"},"words":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"string"},"start":{"type":"number"},"text":{"type":"string"}},"required":["confidence","end","start","text"]}}},"required":["confidence","end","speaker","start","text","words"]}},"confidence":{"type":"number"},"audio_duration":{"type":"number"},"punctuate":{"type":"boolean"},"format_text":{"type":"boolean"},"disfluencies":{"type":"boolean"},"multichannel":{"type":"boolean"},"webhook_url":{"type":"string"},"webhook_status_code":{"type":"number"},"webhook_auth_header_name":{"type":"string"},"speed_boost":{"type":"boolean"},"auto_highlights_result":{"type":"object","properties":{"status":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"count":{"type":"number"},"rank":{"type":"number"},"text":{"type":"string"},"timestamps":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"}},"required":["start","end"]}}},"required":["count","rank","text","timestamps"]}}},"required":["status","results"]},"auto_highlights":{"type":"boolean"},"audio_start_from":{"type":"number"},"audio_end_at":{"type":"number"},"word_boost":{"type":"array","items":{"type":"string"}},"boost_param":{"type":"string"},"filter_profanity":{"type":"boolean"},"redact_pii":{"type":"boolean"},"redact_pii_audio":{"type":"boolean"},"redact_pii_audio_quality":{"type":"string","enum":["mp3","wav"]},"redact_pii_policies":{"type":"array","items":{"type":"string"}},"redact_pii_sub":{"type":"string","enum":["entity_name","hash"]},"speaker_labels":{"type":"boolean"},"speakers_expected":{"type":"number"},"content_safety":{"type":"boolean"},"iab_categories":{"type":"boolean"},"content_safety_labels":{"type":"object","properties":{"status":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"confidence":{"type":"number"},"severity":{"type":"number"}},"required":["label","confidence","severity"]}},"sentences_idx_start":{"type":"number"},"sentences_idx_end":{"type":"number"},"timestamp":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"}},"required":["start","end"]}},"required":["text","labels","sentences_idx_start","sentences_idx_end","timestamp"]}},"summary":{"type":"object","additionalProperties":{"type":"number"}}},"required":["status","results","summary"]},"iab_categories_result":{"type":"object","properties":{"status":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"relevance":{"type":"number"},"label":{"type":"string"}},"required":["relevance","label"]}},"timestamp":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"}},"required":["start","end"]}},"required":["text","labels","timestamp"]}},"summary":{"type":"object","additionalProperties":{"type":"number"}}},"required":["status","results","summary"]},"custom_spelling":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]}},"chapters":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"string"},"headline":{"type":"string"},"gist":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"}},"required":["summary","headline","gist","start","end"]}},"summarization":{"type":"boolean"},"summary_type":{"type":"string"},"summary_model":{"type":"string"},"summary":{"type":"string"},"auto_chapters":{"type":"boolean"},"sentiment_analysis":{"type":"boolean"},"sentiment_analysis_results":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"sentiment":{"type":"string","enum":["POSITIVE","NEUTRAL","NEGATIVE"]},"confidence":{"type":"number"},"speaker":{"type":"string"}},"required":["text","start","end","sentiment","confidence"]}},"entity_detection":{"type":"boolean"},"entities":{"type":"array","items":{"type":"object","properties":{"entity_type":{"type":"string"},"text":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"}},"required":["entity_type","text","start","end"]}},"speech_threshold":{"type":"number"},"throttled":{"type":"boolean"},"error":{"type":"string"}},"required":["id","status"]},{"type":"object","properties":{"text":{"type":"string"},"usage":{"type":"object","properties":{"type":{"type":"string","enum":["tokens"]},"input_tokens":{"type":"number"},"input_token_details":{"type":"object","properties":{"text_tokens":{"type":"number"},"audio_tokens":{"type":"number"}},"required":["text_tokens","audio_tokens"]},"output_tokens":{"type":"number"},"total_tokens":{"type":"number"}},"required":["input_tokens","output_tokens","total_tokens"]}},"required":["text"]}]},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"]}},"required":["id","status","output"]}}}}}}},"/v1/tts":{"post":{"operationId":"_v1_tts","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gpt-4o-mini-tts","openai/gpt-4o-mini-tts","tts-1","openai/tts-1","tts-1-hd","openai/tts-1-hd"]},"text":{"type":"string","minLength":1,"maxLength":4096,"description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer","verse"],"default":"alloy","description":"Name of the voice to be used."},"style":{"type":"string","description":"Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0."},"response_format":{"type":"string","enum":["mp3","opus","aac","flac","wav","pcm"],"default":"mp3","description":"Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response."},"speed":{"type":"number","minimum":0.25,"maximum":4,"default":1,"description":"Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"gpt-4o-mini-tts, openai/gpt-4o-mini-tts, tts-1, openai/tts-1, tts-1-hd, openai/tts-1-hd"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seed-audio-1-0","bytedance/seed-audio-1.0"]},"text":{"type":"string","minLength":1,"maxLength":3000,"description":"Text to synthesize (the TTS prompt). Use @Audio1, @Audio2, etc. to reference audio clips."},"references":{"type":"array","items":{"type":"object","properties":{"speaker":{"type":"string","description":"BytePlus TTS2.0 voice ID or cloned voice ID."},"audio_data":{"type":"string","description":"Base64-encoded reference audio."},"audio_url":{"type":"string","format":"uri","description":"URL of a reference audio file."},"image_data":{"type":"string","description":"Base64-encoded reference image."},"image_url":{"type":"string","format":"uri","description":"URL of a reference image."}}},"maxItems":3,"description":"Reference resources. Supports up to three audio references or one image reference."},"audio_config":{"type":"object","properties":{"format":{"type":"string","enum":["wav","mp3","pcm","ogg_opus"],"default":"wav","description":"The format of the generated music."},"sample_rate":{"anyOf":[{"type":"string","enum":["8000","16000","24000","32000","44100","48000"]},{"type":"integer"}],"description":"The sampling rate of the generated music.","enum":[8000,16000,24000,32000,44100,48000]},"speech_rate":{"type":"integer","minimum":-50,"maximum":100,"default":0,"description":"Speech rate. 100 means 2.0x speed, -50 means 0.5x speed."},"loudness_rate":{"type":"integer","minimum":-50,"maximum":100,"default":0,"description":"Volume. 100 means 2.0x volume, -50 means 0.5x volume."},"pitch_rate":{"type":"integer","minimum":-12,"maximum":12,"default":0,"description":"Pitch adjustment."}}},"watermark":{"type":"object","properties":{"aigc_watermark":{"type":"boolean","default":false,"description":"Adds an explicit audio rhythm marker."},"aigc_metadata":{"type":"object","properties":{"enable":{"type":"boolean","default":false},"content_producer":{"type":"string"},"produce_id":{"type":"string"},"content_propagator":{"type":"string"},"propagate_id":{"type":"string"}},"description":"Implicit watermark metadata."}}}},"required":["model","text"],"title":"bytedance/seed-audio-1-0, bytedance/seed-audio-1.0"},{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/eleven_multilingual_v2","elevenlabs/eleven_turbo_v2_5"]},"text":{"type":"string","description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Rachel","Bella","Roger","Sarah","Laura","Charlie","George","Callum","River","Harry","Liam","Alice","Matilda","Will","Jessica","Eric","Chris","Brian","Daniel","Lily","Adam","Bill","Drew","Clyde","Paul","Aria","Domi","Dave","Fin","Antoni","Thomas","Emily","Elli","Patrick","Dorothy","Josh","Charlotte","James","Joseph","Jeremy","Michael","Ethan","Gigi","Freya","Grace","Serena","Nicole","Jessie","Sam","Glinda","Giovanni","Mimi"],"default":"Rachel","description":"Name of the voice to be used."},"apply_text_normalization":{"type":"string","enum":["auto","on","off"],"description":"This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped."},"output_format":{"type":"string","enum":["mp3_22050_32","mp3_44100_32","mp3_44100_64","mp3_44100_96","mp3_44100_128","mp3_44100_192","pcm_8000","pcm_16000","pcm_22050","pcm_24000","pcm_44100","pcm_48000","ulaw_8000","alaw_8000","opus_48000_32","opus_48000_64","opus_48000_96","opus_48000_128","opus_48000_192"],"description":"Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response."},"voice_settings":{"type":"object","properties":{"stability":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion."},"use_speaker_boost":{"type":"boolean","default":true,"description":"This setting boosts the similarity to the original speaker. Using this setting requires a slightly higher computational load, which in turn increases latency."},"similarity_boost":{"type":"number","minimum":0,"maximum":1,"default":0.75,"description":"Determines how closely the AI should adhere to the original voice when attempting to replicate it."},"style":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0."},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"default":1,"description":"Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up."}},"description":"Voice settings overriding stored settings for the given voice. They are applied only on the given request."},"seed":{"type":"integer","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed."},"stream":{"type":"boolean","default":true},"next_text":{"type":"string","description":"The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation."},"previous_text":{"type":"string","description":"The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation."}},"required":["model","text"],"title":"elevenlabs/eleven_multilingual_v2, elevenlabs/eleven_turbo_v2_5"},{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/v3_alpha"]},"text":{"type":"string","description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Rachel","Bella","Roger","Sarah","Laura","Charlie","George","Callum","River","Harry","Liam","Alice","Matilda","Will","Jessica","Eric","Chris","Brian","Daniel","Lily","Adam","Bill","Drew","Clyde","Paul","Aria","Domi","Dave","Fin","Antoni","Thomas","Emily","Elli","Patrick","Dorothy","Josh","Charlotte","James","Joseph","Jeremy","Michael","Ethan","Gigi","Freya","Grace","Serena","Nicole","Jessie","Sam","Glinda","Giovanni","Mimi"],"default":"Rachel","description":"Name of the voice to be used."},"apply_text_normalization":{"type":"string","enum":["auto","on","off"],"description":"This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped."},"output_format":{"type":"string","enum":["mp3_22050_32","mp3_44100_32","mp3_44100_64","mp3_44100_96","mp3_44100_128","mp3_44100_192","pcm_8000","pcm_16000","pcm_22050","pcm_24000","pcm_44100","pcm_48000","ulaw_8000","alaw_8000","opus_48000_32","opus_48000_64","opus_48000_96","opus_48000_128","opus_48000_192"],"description":"Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response."},"voice_settings":{"type":"object","properties":{"stability":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion."},"use_speaker_boost":{"type":"boolean","default":true,"description":"This setting boosts the similarity to the original speaker. Using this setting requires a slightly higher computational load, which in turn increases latency."},"similarity_boost":{"type":"number","minimum":0,"maximum":1,"default":0.75,"description":"Determines how closely the AI should adhere to the original voice when attempting to replicate it."},"style":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0."},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"default":1,"description":"Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up."}},"description":"Voice settings overriding stored settings for the given voice. They are applied only on the given request."},"seed":{"type":"integer","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed."},"stream":{"type":"boolean","default":true}},"required":["model","text"],"title":"elevenlabs/v3_alpha"},{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/eleven_v4","elevenlabs/eleven_v4_turbo"]},"text":{"type":"string","description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Rachel","Bella","Roger","Sarah","Laura","Charlie","George","Callum","River","Harry","Liam","Alice","Matilda","Will","Jessica","Eric","Chris","Brian","Daniel","Lily","Adam","Bill","Drew","Clyde","Paul","Aria","Domi","Dave","Fin","Antoni","Thomas","Emily","Elli","Patrick","Dorothy","Josh","Charlotte","James","Joseph","Jeremy","Michael","Ethan","Gigi","Freya","Grace","Serena","Nicole","Jessie","Sam","Glinda","Giovanni","Mimi"],"default":"Rachel","description":"Name of the voice to be used."},"apply_text_normalization":{"type":"string","enum":["auto","on","off"],"description":"This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped."},"output_format":{"type":"string","enum":["mp3_22050_32","mp3_44100_32","mp3_44100_64","mp3_44100_96","mp3_44100_128","mp3_44100_192","pcm_8000","pcm_16000","pcm_22050","pcm_24000","pcm_44100","pcm_48000","ulaw_8000","alaw_8000","opus_48000_32","opus_48000_64","opus_48000_96","opus_48000_128","opus_48000_192"],"description":"Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response."},"voice_settings":{"type":"object","properties":{"stability":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion."},"similarity_boost":{"type":"number","minimum":0,"maximum":1,"default":0.75,"description":"Determines how closely the AI should adhere to the original voice when attempting to replicate it."}},"description":"Voice settings overriding stored settings for the given voice. They are applied only on the given request."},"seed":{"type":"integer","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed."},"stream":{"type":"boolean","default":true},"next_text":{"type":"string","description":"The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation."},"previous_text":{"type":"string","description":"The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation."}},"required":["model","text"],"title":"elevenlabs/eleven_v4, elevenlabs/eleven_v4_turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["qwen3-tts-flash","alibaba/qwen3-tts-flash"]},"text":{"type":"string","minLength":1,"maxLength":600,"description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Cherry","Ethan","Nofish","Jennifer","Ryan","Katerina","Elias","Jada","Dylan","Sunny","Li","Marcus","Roy","Peter","Rocky","Kiki","Eric"],"default":"Cherry","description":"Name of the voice to be used."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"qwen3-tts-flash, alibaba/qwen3-tts-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/speech-2.5-turbo-preview","minimax/speech-2.5-hd-preview","minimax/speech-2.6-hd","minimax/speech-2.6-turbo","minimax/speech-2.8-turbo","minimax/speech-2.8-hd"]},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"The text content to be converted to speech."},"voice_setting":{"type":"object","properties":{"voice_id":{"anyOf":[{"type":"string","enum":["Wise_Woman","Friendly_Person","Inspirational_girl","Deep_Voice_Man","Calm_Woman","Casual_Guy","Lively_Girl","Patient_Man","Young_Knight","Determined_Man","Lovely_Girl","Decent_Boy","Imposing_Manner","Elegant_Man","Abbess","Sweet_Girl_2","Exuberant_Girl"]},{"type":"string","minLength":1,"maxLength":64}],"default":"Wise_Woman","description":"A predefined system voice for text-to-speech synthesis."},"speed":{"type":"number","minimum":0.5,"maximum":2,"default":1,"description":"Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up."},"vol":{"type":"number","minimum":0.01,"maximum":10,"default":1,"description":"The volume of the generated speech. Range: (0, 10]. Larger values indicate larger volumes."},"pitch":{"type":"integer","minimum":-12,"maximum":12,"default":0,"description":"The pitch of the generated speech. Range: [-12, 12]. 0 = default voice output."},"emotion":{"type":"string","enum":["happy","sad","angry","fearful","disgusted","surprised","neutral"],"description":"Emotional tone to apply to the synthesized speech. Controls the emotional expression of the generated voice output."},"text_normalization":{"type":"boolean","default":false,"description":"English text normalization support. Improves number-reading but increases latency."}},"default":{"voice_id":"Wise_Woman"},"description":"Voice settings overriding stored settings for the given voice. They are applied only on the given request."},"audio_setting":{"type":"object","properties":{"sample_rate":{"type":"integer","description":"Audio sample rate in Hz.","enum":[8000,16000,22050,24000,32000,44100],"default":"32000"},"bitrate":{"type":"integer","description":"Audio bitrate in bits per second. Controls the compression level and audio quality. Higher bitrates provide better quality but larger file sizes.","enum":[32000,64000,128000,256000],"default":"128000"},"format":{"type":"string","enum":["mp3","pcm","flac"],"default":"mp3","description":"Audio output format. MP3 provides good compression and compatibility, PCM offers uncompressed high quality, and FLAC provides lossless compression."},"channel":{"type":"integer","description":"Number of audio channels. 1 for mono (single channel), 2 for stereo (dual channel) output.","enum":[1,2],"default":"1"}},"description":"Audio output configuration"},"pronunciation_dict":{"type":"object","properties":{"tone":{"type":"array","items":{"type":"string"},"description":"Replacement of text and pronunciations. Format: [\"燕少飞/(yan4)(shao3)(fei1)\", \"达菲/(da2)(fei1)\", \"omg/oh my god\"]"}},"required":["tone"],"description":"Custom pronunciation dictionary for handling specific words or phrases. Allows fine-tuning of how certain text should be pronounced using phonetic representations."},"timbre_weights":{"type":"array","items":{"type":"object","properties":{"voice_id":{"anyOf":[{"type":"string","enum":["Wise_Woman","Friendly_Person","Inspirational_girl","Deep_Voice_Man","Calm_Woman","Casual_Guy","Lively_Girl","Patient_Man","Young_Knight","Determined_Man","Lovely_Girl","Decent_Boy","Imposing_Manner","Elegant_Man","Abbess","Sweet_Girl_2","Exuberant_Girl"]},{"type":"string","minLength":1,"maxLength":64}],"description":"A predefined system voice for text-to-speech synthesis."},"weight":{"type":"integer","minimum":1,"maximum":100,"description":"Weight for voice mixing. Range: [1, 100]. Higher weights are sampled more heavily."}},"required":["voice_id","weight"]},"maxItems":4,"description":"Voice mixing configuration allowing combination of up to 4 different voices with specified weights. Each voice contributes to the final output based on its weight value (1-100)."},"language_boost":{"type":"string","enum":["Chinese","Chinese,Yue","English","Arabic","Russian","Spanish","French","Portuguese","German","Turkish","Dutch","Ukrainian","Vietnamese","Indonesian","Japanese","Italian","Korean","Thai","Polish","Romanian","Greek","Czech","Finnish","Hindi","Bulgarian","Danish","Hebrew","Malay","Persian","Slovak","Swedish","Croatian","Filipino","Hungarian","Norwegian","Slovenian","Catalan","Nynorsk","Tamil","Afrikaans","auto"],"description":"Language recognition enhancement option."},"voice_modify":{"type":"object","properties":{"pitch":{"type":"integer","minimum":-100,"maximum":100,"description":"Pitch level (-100 to 100)"},"intensity":{"type":"integer","minimum":-100,"maximum":100,"description":"Intensity level (-100 to 100)"},"timbre":{"type":"integer","minimum":-100,"maximum":100,"description":"Timbre level (-100 to 100)"},"sound_effects":{"type":"string","enum":["spacious_echo","auditorium_echo","lofi_telephone","robotic"],"description":"Audio effects to apply to the synthesized speech. Includes options like spacious_echo, auditorium_echo, lofi_telephone, and robotic effects."}},"description":"Voice modification settings for adjusting pitch, intensity, timbre, and applying sound effects to customize the voice characteristics."},"subtitle_enable":{"type":"boolean","default":false,"description":"Enable subtitle generation service. Only available for non-streaming requests. Generates timing information for the synthesized speech."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"minimax/speech-2.5-turbo-preview, minimax/speech-2.5-hd-preview, minimax/speech-2.6-hd, minimax/speech-2.6-turbo, minimax/speech-2.8-turbo, minimax/speech-2.8-hd"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/voice-1","heygen/voice-1-turbo"]},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"Text to speak (1–5000 characters). Billed per character."},"voice_id":{"type":"string","minLength":1,"default":"6c5a16cb1ce6469a85b80798be89d95c","description":"ID of a public HeyGen voice."},"language":{"type":"string","description":"Language code of the text, for example \"en\". Detected from the text when omitted."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"heygen/voice-1, heygen/voice-1-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["aura","deepgram/aura","aura-asteria-en","deepgram/aura-asteria-en","#g1_aura-asteria-en","aura-hera-en","deepgram/aura-hera-en","#g1_aura-hera-en","aura-luna-en","deepgram/aura-luna-en","#g1_aura-luna-en","aura-stella-en","deepgram/aura-stella-en","#g1_aura-stella-en","aura-athena-en","deepgram/aura-athena-en","#g1_aura-athena-en","aura-zeus-en","deepgram/aura-zeus-en","#g1_aura-zeus-en","aura-orion-en","deepgram/aura-orion-en","#g1_aura-orion-en","aura-arcas-en","deepgram/aura-arcas-en","#g1_aura-arcas-en","aura-perseus-en","deepgram/aura-perseus-en","#g1_aura-perseus-en","aura-angus-en","deepgram/aura-angus-en","#g1_aura-angus-en","aura-orpheus-en","deepgram/aura-orpheus-en","#g1_aura-orpheus-en","aura-helios-en","deepgram/aura-helios-en","#g1_aura-helios-en"]},"text":{"type":"string","description":"The text content to be converted to speech."},"container":{"type":"string","description":"The file format wrapper for the output audio. The available options depend on the encoding type."},"encoding":{"type":"string","enum":["linear16","mulaw","alaw","mp3","opus","flac","aac"],"default":"linear16","description":"Specifies the expected encoding of your audio output"},"sample_rate":{"type":"string","description":"Audio sample rate in Hz."},"stream":{"type":"boolean","default":true},"voice":{"type":"string","enum":["asteria","hera","luna","stella","athena","zeus","orion","arcas","perseus","angus","orpheus","helios"],"description":"Name of the voice to be used."}},"required":["model","text"],"title":"aura, deepgram/aura, aura-asteria-en, deepgram/aura-asteria-en, #g1_aura-asteria-en, aura-hera-en, deepgram/aura-hera-en, #g1_aura-hera-en, aura-luna-en, deepgram/aura-luna-en, #g1_aura-luna-en, aura-stella-en, deepgram/aura-stella-en, #g1_aura-stella-en, aura-athena-en, deepgram/aura-athena-en, #g1_aura-athena-en, aura-zeus-en, deepgram/aura-zeus-en, #g1_aura-zeus-en, aura-orion-en, deepgram/aura-orion-en, #g1_aura-orion-en, aura-arcas-en, deepgram/aura-arcas-en, #g1_aura-arcas-en, aura-perseus-en, deepgram/aura-perseus-en, #g1_aura-perseus-en, aura-angus-en, deepgram/aura-angus-en, #g1_aura-angus-en, aura-orpheus-en, deepgram/aura-orpheus-en, #g1_aura-orpheus-en, aura-helios-en, deepgram/aura-helios-en, #g1_aura-helios-en"},{"type":"object","properties":{"model":{"type":"string","enum":["aura-2","deepgram/aura-2","aura-2-amalthea-en","deepgram/aura-2-amalthea-en","#g1_aura-2-amalthea-en","aura-2-andromeda-en","deepgram/aura-2-andromeda-en","#g1_aura-2-andromeda-en","aura-2-apollo-en","deepgram/aura-2-apollo-en","#g1_aura-2-apollo-en","aura-2-arcas-en","deepgram/aura-2-arcas-en","#g1_aura-2-arcas-en","aura-2-aries-en","deepgram/aura-2-aries-en","#g1_aura-2-aries-en","aura-2-asteria-en","deepgram/aura-2-asteria-en","#g1_aura-2-asteria-en","aura-2-athena-en","deepgram/aura-2-athena-en","#g1_aura-2-athena-en","aura-2-atlas-en","deepgram/aura-2-atlas-en","#g1_aura-2-atlas-en","aura-2-aurora-en","deepgram/aura-2-aurora-en","#g1_aura-2-aurora-en","aura-2-callista-en","deepgram/aura-2-callista-en","#g1_aura-2-callista-en","aura-2-cora-en","deepgram/aura-2-cora-en","#g1_aura-2-cora-en","aura-2-cordelia-en","deepgram/aura-2-cordelia-en","#g1_aura-2-cordelia-en","aura-2-delia-en","deepgram/aura-2-delia-en","#g1_aura-2-delia-en","aura-2-draco-en","deepgram/aura-2-draco-en","#g1_aura-2-draco-en","aura-2-electra-en","deepgram/aura-2-electra-en","#g1_aura-2-electra-en","aura-2-harmonia-en","deepgram/aura-2-harmonia-en","#g1_aura-2-harmonia-en","aura-2-helena-en","deepgram/aura-2-helena-en","#g1_aura-2-helena-en","aura-2-hera-en","deepgram/aura-2-hera-en","#g1_aura-2-hera-en","aura-2-hermes-en","deepgram/aura-2-hermes-en","#g1_aura-2-hermes-en","aura-2-hyperion-en","deepgram/aura-2-hyperion-en","#g1_aura-2-hyperion-en","aura-2-iris-en","deepgram/aura-2-iris-en","#g1_aura-2-iris-en","aura-2-janus-en","deepgram/aura-2-janus-en","#g1_aura-2-janus-en","aura-2-juno-en","deepgram/aura-2-juno-en","#g1_aura-2-juno-en","aura-2-jupiter-en","deepgram/aura-2-jupiter-en","#g1_aura-2-jupiter-en","aura-2-luna-en","deepgram/aura-2-luna-en","#g1_aura-2-luna-en","aura-2-mars-en","deepgram/aura-2-mars-en","#g1_aura-2-mars-en","aura-2-minerva-en","deepgram/aura-2-minerva-en","#g1_aura-2-minerva-en","aura-2-neptune-en","deepgram/aura-2-neptune-en","#g1_aura-2-neptune-en","aura-2-odysseus-en","deepgram/aura-2-odysseus-en","#g1_aura-2-odysseus-en","aura-2-ophelia-en","deepgram/aura-2-ophelia-en","#g1_aura-2-ophelia-en","aura-2-orion-en","deepgram/aura-2-orion-en","#g1_aura-2-orion-en","aura-2-orpheus-en","deepgram/aura-2-orpheus-en","#g1_aura-2-orpheus-en","aura-2-pandora-en","deepgram/aura-2-pandora-en","#g1_aura-2-pandora-en","aura-2-phoebe-en","deepgram/aura-2-phoebe-en","#g1_aura-2-phoebe-en","aura-2-pluto-en","deepgram/aura-2-pluto-en","#g1_aura-2-pluto-en","aura-2-saturn-en","deepgram/aura-2-saturn-en","#g1_aura-2-saturn-en","aura-2-selene-en","deepgram/aura-2-selene-en","#g1_aura-2-selene-en","aura-2-thalia-en","deepgram/aura-2-thalia-en","#g1_aura-2-thalia-en","aura-2-theia-en","deepgram/aura-2-theia-en","#g1_aura-2-theia-en","aura-2-vesta-en","deepgram/aura-2-vesta-en","#g1_aura-2-vesta-en","aura-2-zeus-en","deepgram/aura-2-zeus-en","#g1_aura-2-zeus-en","aura-2-celeste-es","deepgram/aura-2-celeste-es","#g1_aura-2-celeste-es","aura-2-estrella-es","deepgram/aura-2-estrella-es","#g1_aura-2-estrella-es","aura-2-nestor-es","deepgram/aura-2-nestor-es","#g1_aura-2-nestor-es"]},"text":{"type":"string","description":"The text content to be converted to speech."},"container":{"type":"string","description":"The file format wrapper for the output audio. The available options depend on the encoding type."},"encoding":{"type":"string","enum":["linear16","mulaw","alaw","mp3","opus","flac","aac"],"default":"linear16","description":"Specifies the expected encoding of your audio output"},"sample_rate":{"type":"string","description":"Audio sample rate in Hz."},"stream":{"type":"boolean","default":true},"voice":{"type":"string","enum":["amalthea","andromeda","apollo","arcas","aries","asteria","athena","atlas","aurora","callista","cora","cordelia","delia","draco","electra","harmonia","helena","hera","hermes","hyperion","iris","janus","juno","jupiter","luna","mars","minerva","neptune","odysseus","ophelia","orion","orpheus","pandora","phoebe","pluto","saturn","selene","thalia","theia","vesta","zeus","celeste","estrella","nestor"],"description":"Name of the voice to be used."}},"required":["model","text"],"title":"aura-2, deepgram/aura-2, aura-2-amalthea-en, deepgram/aura-2-amalthea-en, #g1_aura-2-amalthea-en, aura-2-andromeda-en, deepgram/aura-2-andromeda-en, #g1_aura-2-andromeda-en, aura-2-apollo-en, deepgram/aura-2-apollo-en, #g1_aura-2-apollo-en, aura-2-arcas-en, deepgram/aura-2-arcas-en, #g1_aura-2-arcas-en, aura-2-aries-en, deepgram/aura-2-aries-en, #g1_aura-2-aries-en, aura-2-asteria-en, deepgram/aura-2-asteria-en, #g1_aura-2-asteria-en, aura-2-athena-en, deepgram/aura-2-athena-en, #g1_aura-2-athena-en, aura-2-atlas-en, deepgram/aura-2-atlas-en, #g1_aura-2-atlas-en, aura-2-aurora-en, deepgram/aura-2-aurora-en, #g1_aura-2-aurora-en, aura-2-callista-en, deepgram/aura-2-callista-en, #g1_aura-2-callista-en, aura-2-cora-en, deepgram/aura-2-cora-en, #g1_aura-2-cora-en, aura-2-cordelia-en, deepgram/aura-2-cordelia-en, #g1_aura-2-cordelia-en, aura-2-delia-en, deepgram/aura-2-delia-en, #g1_aura-2-delia-en, aura-2-draco-en, deepgram/aura-2-draco-en, #g1_aura-2-draco-en, aura-2-electra-en, deepgram/aura-2-electra-en, #g1_aura-2-electra-en, aura-2-harmonia-en, deepgram/aura-2-harmonia-en, #g1_aura-2-harmonia-en, aura-2-helena-en, deepgram/aura-2-helena-en, #g1_aura-2-helena-en, aura-2-hera-en, deepgram/aura-2-hera-en, #g1_aura-2-hera-en, aura-2-hermes-en, deepgram/aura-2-hermes-en, #g1_aura-2-hermes-en, aura-2-hyperion-en, deepgram/aura-2-hyperion-en, #g1_aura-2-hyperion-en, aura-2-iris-en, deepgram/aura-2-iris-en, #g1_aura-2-iris-en, aura-2-janus-en, deepgram/aura-2-janus-en, #g1_aura-2-janus-en, aura-2-juno-en, deepgram/aura-2-juno-en, #g1_aura-2-juno-en, aura-2-jupiter-en, deepgram/aura-2-jupiter-en, #g1_aura-2-jupiter-en, aura-2-luna-en, deepgram/aura-2-luna-en, #g1_aura-2-luna-en, aura-2-mars-en, deepgram/aura-2-mars-en, #g1_aura-2-mars-en, aura-2-minerva-en, deepgram/aura-2-minerva-en, #g1_aura-2-minerva-en, aura-2-neptune-en, deepgram/aura-2-neptune-en, #g1_aura-2-neptune-en, aura-2-odysseus-en, deepgram/aura-2-odysseus-en, #g1_aura-2-odysseus-en, aura-2-ophelia-en, deepgram/aura-2-ophelia-en, #g1_aura-2-ophelia-en, aura-2-orion-en, deepgram/aura-2-orion-en, #g1_aura-2-orion-en, aura-2-orpheus-en, deepgram/aura-2-orpheus-en, #g1_aura-2-orpheus-en, aura-2-pandora-en, deepgram/aura-2-pandora-en, #g1_aura-2-pandora-en, aura-2-phoebe-en, deepgram/aura-2-phoebe-en, #g1_aura-2-phoebe-en, aura-2-pluto-en, deepgram/aura-2-pluto-en, #g1_aura-2-pluto-en, aura-2-saturn-en, deepgram/aura-2-saturn-en, #g1_aura-2-saturn-en, aura-2-selene-en, deepgram/aura-2-selene-en, #g1_aura-2-selene-en, aura-2-thalia-en, deepgram/aura-2-thalia-en, #g1_aura-2-thalia-en, aura-2-theia-en, deepgram/aura-2-theia-en, #g1_aura-2-theia-en, aura-2-vesta-en, deepgram/aura-2-vesta-en, #g1_aura-2-vesta-en, aura-2-zeus-en, deepgram/aura-2-zeus-en, #g1_aura-2-zeus-en, aura-2-celeste-es, deepgram/aura-2-celeste-es, #g1_aura-2-celeste-es, aura-2-estrella-es, deepgram/aura-2-estrella-es, #g1_aura-2-estrella-es, aura-2-nestor-es, deepgram/aura-2-nestor-es, #g1_aura-2-nestor-es"},{"type":"object","properties":{"model":{"type":"string","enum":["octave-2","hume/octave-2"]},"text":{"type":"string","minLength":1,"maxLength":500000,"description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Vince Douglas","Male English Actor","Ava Song","Campfire Narrator","TikTok Fashion Influencer","Colton Rivers","Literature Professor","Booming American Narrator","Imani Carter","Terrence Bentley","Nature Documentary Narrator","Alice Bennett","Sitcom Girl","Unserious Movie Trailer Narrator","Articulate ASMR British Narrator","Big Dicky","English Children's Book Narrator","Sebastian Lockwood","Donovan Sinclair","Booming British Narrator","Relaxing ASMR Woman","Lady Elizabeth","Male Protagonist","Tough Guy","French Chef","Spanish Instructor","Charming Cowgirl"],"default":"Vince Douglas","description":"Name of the voice to be used."},"format":{"type":"string","enum":["wav","mp3"],"default":"wav","description":"Audio output format. MP3 provides good compression and compatibility, PCM offers uncompressed high quality, and FLAC provides lossless compression."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"octave-2, hume/octave-2"},{"type":"object","properties":{"model":{"type":"string","enum":["inworld/tts-1","inworld/tts-1-max","inworld/tts-1-5-max","inworld/tts-1-5-mini"]},"text":{"type":"string","minLength":1,"maxLength":500000,"description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Alex","Ashley","Craig","Deborah","Dennis","Dominus","Edward","Elizabeth","Hades","Heitor","Julia","Maitê","Mark","Olivia","Pixie","Priya","Ronald","Sarah","Shaun","Theodore","Timothy","Wendy"],"default":"Alex","description":"Name of the voice to be used."},"format":{"type":"string","enum":["wav","mp3"],"default":"wav","description":"Audio output format. WAV delivers uncompressed audio in a widely supported container format, while MP3 provides good compression and compatibility."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"inworld/tts-1, inworld/tts-1-max, inworld/tts-1-5-max, inworld/tts-1-5-mini"},{"type":"object","properties":{"model":{"type":"string","enum":["vibevoice/7b","vibevoice","microsoft/vibevoice-7b","microsoft/vibevoice-1.5b"]},"script":{"type":"string","minLength":1,"maxLength":5000,"description":"The script to convert to speech. Can be formatted with \"Speaker X:\" prefixes for multi-speaker dialogues."},"speakers":{"type":"array","items":{"type":"object","properties":{"preset":{"type":"string","enum":["Alice [EN]","Alice [EN] (Background Music)","Carter [EN]","Frank [EN]","Maya [EN]","Anchen [ZH] (Background Music)","Bowen [ZH]","Xinran [ZH]"],"description":"Default voice preset to use for the speaker. Not used if audio_url is provided."},"audio_url":{"type":"string","format":"uri","description":"URL to a voice sample audio file. If provided, preset will be ignored."}}},"minItems":1,"maxItems":4,"default":[{"preset":"Alice [EN]"}],"description":"List of speakers to use for the script. If not provided, will be inferred from the script or voice samples."},"seed":{"type":"integer","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed."},"cfg_scale":{"type":"number","minimum":0.1,"maximum":2,"default":1.3,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","script"],"title":"vibevoice/7b, vibevoice, microsoft/vibevoice-7b, microsoft/vibevoice-1.5b"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","format":"uri"},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["audio"]}},"audio/wav":{"schema":{"type":"string","format":"binary","description":"Audio stream"}}}}}}},"/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","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":32000,"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, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1"},{"type":"object","properties":{"model":{"type":"string","enum":["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","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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-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, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5"},{"type":"object","properties":{"model":{"type":"string","enum":["claude-opus-4-6","anthropic/claude-opus-4-6"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"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-6, anthropic/claude-opus-4-6"},{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","anthropic/claude-sonnet-4-6","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","max"],"description":"How much the model spends on the whole response: thinking, text and tool calls. `low` is the fastest and cheapest, `max` the most thorough. When omitted, the model uses its own default level. `none` selects the least reasoning the model allows: it turns thinking off where the model supports that, and sends `low` where thinking cannot be switched off."}},"description":"Output configuration. `effort` controls reasoning depth and total token spend; use it instead of `thinking.budget_tokens` on models with adaptive thinking."},"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-sonnet-4-6, anthropic/claude-sonnet-4-6, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6"},{"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-opus-5","anthropic/claude-opus-5","claude-fable-5-1","anthropic/claude-fable-5-1","claude-opus-5-5","anthropic/claude-opus-5-5","claude-sonnet-5-5","anthropic/claude-sonnet-5-5","claude-haiku-5-5","anthropic/claude-haiku-5-5","claude-fable-5-2","anthropic/claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-sonnet-5","claude-sonnet-5"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"How much the model spends on the whole response: thinking, text and tool calls. `low` is the fastest and cheapest, `max` the most thorough. When omitted, the model uses its own default level. `none` selects the least reasoning the model allows: it turns thinking off where the model supports that, and sends `low` where thinking cannot be switched off."}},"description":"Output configuration. `effort` controls reasoning depth and total token spend; use it instead of `thinking.budget_tokens` on models with adaptive thinking."}},"required":["model","messages"],"title":"claude-opus-4-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-opus-5, anthropic/claude-opus-5, claude-fable-5-1, anthropic/claude-fable-5-1, claude-opus-5-5, anthropic/claude-opus-5-5, claude-sonnet-5-5, anthropic/claude-sonnet-5-5, claude-haiku-5-5, anthropic/claude-haiku-5-5, claude-fable-5-2, anthropic/claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-sonnet-5, claude-sonnet-5"},{"type":"object","properties":{"model":{"type":"string","enum":["claude-opus-5","anthropic/claude-opus-5","anthropic/claude-opus-4-6","claude-opus-4-6","anthropic/claude-opus-4-7","claude-opus-4-7","anthropic/claude-opus-4-8","claude-opus-4-8","anthropic/claude-fable-5-1","claude-fable-5-1","anthropic/claude-opus-5-5","claude-opus-5-5","anthropic/claude-sonnet-5-5","claude-sonnet-5-5","anthropic/claude-haiku-5-5","claude-haiku-5-5","anthropic/claude-fable-5-2","claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-fable-latest","claude-fable-latest","anthropic/claude-opus-4.6","claude-opus-4.6","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-opus-latest","claude-opus-latest","anthropic/claude-sonnet-5","claude-sonnet-5","anthropic/claude-sonnet-latest","claude-sonnet-latest"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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-5, anthropic/claude-opus-5, anthropic/claude-opus-4-6, claude-opus-4-6, anthropic/claude-opus-4-7, claude-opus-4-7, anthropic/claude-opus-4-8, claude-opus-4-8, anthropic/claude-fable-5-1, claude-fable-5-1, anthropic/claude-opus-5-5, claude-opus-5-5, anthropic/claude-sonnet-5-5, claude-sonnet-5-5, anthropic/claude-haiku-5-5, claude-haiku-5-5, anthropic/claude-fable-5-2, claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-fable-latest, claude-fable-latest, anthropic/claude-opus-4.6, claude-opus-4.6, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-opus-latest, claude-opus-latest, anthropic/claude-sonnet-5, claude-sonnet-5, anthropic/claude-sonnet-latest, claude-sonnet-latest"},{"type":"object","properties":{"model":{"type":"string","enum":["anthropic/claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929","anthropic/claude-haiku-4-5-20251001","claude-haiku-4-5-20251001","anthropic/claude-opus-4-5-20251101","claude-opus-4-5-20251101","anthropic/claude-sonnet-4-6","claude-sonnet-4-6","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-haiku-latest","claude-haiku-latest","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-sonnet-4","claude-sonnet-4","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."}},"required":["model","messages"],"title":"anthropic/claude-sonnet-4-5-20250929, claude-sonnet-4-5-20250929, anthropic/claude-haiku-4-5-20251001, claude-haiku-4-5-20251001, anthropic/claude-opus-4-5-20251101, claude-opus-4-5-20251101, anthropic/claude-sonnet-4-6, claude-sonnet-4-6, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-haiku-latest, claude-haiku-latest, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-sonnet-4, claude-sonnet-4, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6"},{"type":"object","properties":{"model":{"type":"string","enum":["test/dummy"]},"messages":{"type":"array","items":{"nullable":true},"minItems":1},"max_tokens":{"type":"integer","minimum":1},"system":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}}]},"stream":{"type":"boolean"},"test":{"type":"object","properties":{"credits":{"type":"number"},"delay":{"type":"number"},"errorStatus":{"type":"number"}}}},"required":["model","messages","max_tokens"],"title":"test/dummy"},{"type":"object","properties":{"model":{"type":"string","enum":["anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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":32000,"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":"anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1"},{"type":"object","properties":{"model":{"type":"string","enum":["gpt-5.4-2026-03-05","openai/gpt-5.4-2026-03-05","gpt-5.5-2026-04-23","openai/gpt-5.5-2026-04-23","gpt-6-sol","openai/gpt-6-sol","gpt-6.1-terra","openai/gpt-6.1-terra","gpt-6-luna","openai/gpt-6-luna","gpt-6.1-terra-pro","openai/gpt-6.1-terra-pro","openai/gpt-5-4","openai/gpt-5-5","bytedance/seed-2-0-pro","bytedance/seed-2-0-code-preview","bytedance/dola-seed-2-0-pro","bytedance/dola-seed-2-0-code","deepseek-chat","deepseek/deepseek-chat","longcat-2.0","meituan/longcat-2.0","gemini-4-hydrogen","google/gemini-4-hydrogen","muse-ember","meta/muse-ember","mistral-large-2512","mistralai/mistral-large-2512","alibaba/glm-5.2","glm-5.2-fast-preview","alibaba/glm-5.2-fast-preview","qwen-max","alibaba/qwen-max","qwen-turbo","alibaba/qwen-turbo","qwen3.5-flash","alibaba/qwen3.5-flash","qwen3.5-plus","alibaba/qwen3.5-plus","qwen3-max-preview","alibaba/qwen3-max-preview","qwen3-max","alibaba/qwen3-max","qwen3-vl-plus","alibaba/qwen3-vl-plus","qwen3-vl-flash","alibaba/qwen3-vl-flash","qwen3-vl-32b-thinking","alibaba/qwen3-vl-32b-thinking","qwen3-vl-32b-instruct","alibaba/qwen3-vl-32b-instruct","qwen3.5-omni-plus","alibaba/qwen3.5-omni-plus","qwen3.5-omni-flash","alibaba/qwen3.5-omni-flash","qwen3.8-omni-flash","alibaba/qwen3.8-omni-flash","qwen3.6-max-preview","alibaba/qwen3.6-max-preview","qwen3.7-max","alibaba/qwen3.7-max","qwen3.8-max","alibaba/qwen3.8-max","qwen4-max","alibaba/qwen4-max","qwen3.8-flash","alibaba/qwen3.8-flash","qwen3.7-plus","alibaba/qwen3.7-plus","qwen3.6-plus","alibaba/qwen3.6-plus","qwen3.6-flash","alibaba/qwen3.6-flash","qwen3.6-27b","alibaba/qwen3.6-27b","qwen3.6-35b-a3b","alibaba/qwen3.6-35b-a3b","zhipu/glm-5-2-fast-preview","alibaba/qwen3.5-plus-20260218","minimax/m2","MiniMax-M2","minimax/m2-1","MiniMax-M2.1","minimax/m2-1-highspeed","MiniMax-M2.1-Highspeed","minimax/m2-5-20260218","MiniMax-M2.5","minimax/minimax-m3","MiniMax-M3","minimax/m2-7-20260402","MiniMax-M2.7","minimax/m2-7-highspeed","MiniMax-M2.7-Highspeed","minimax/m2-5-highspeed-20260218","MiniMax-M2.5-Highspeed","moonshot/kimi-k2-5","kimi-k2-5","moonshot/kimi-k2-6","moonshot/kimi-k2-7-code","kimi-k2-7-code","moonshot/kimi-k2-7-code-highspeed","kimi-k2-7-code-highspeed","moonshot/kimi-k3-1-pro","moonshot/kimi-k3.1-pro","moonshot/kimi-k3-1-pro-highspeed","moonshot/kimi-k3.1-pro-highspeed","ernie-5.0","baidu/ernie-5.0","baidu/ernie-5.5-flash-preview","ernie-5.5-flash-preview","x-ai/grok-3-beta","grok-3","x-ai/grok-3-mini-beta","grok-3-mini","grok-4-fast-reasoning","x-ai/grok-4-fast-reasoning","grok-4-fast-non-reasoning","x-ai/grok-4-fast-non-reasoning","grok-4-1-fast-reasoning","x-ai/grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","x-ai/grok-4-1-fast-non-reasoning","x-ai/grok-4-3","grok-4-3","x-ai/grok-4-5","grok-4-5","x-ai/grok-4-6","grok-4-6","x-ai/grok-4-7","grok-4-7","x-ai/grok-code-fast-1","grok-code-fast-1","xai/grok-build-0-1","x-ai/grok-build-0-1","grok-build-0-1","labs-leanstral-1-5","mistral/labs-leanstral-1-5","leanstral-1-5","mistral/leanstral-1-5","mercury-3","inception/mercury-3","ling-3.0-tiny","inclusionai/ling-3.0-tiny","ternary-bonsai-2-9b","prism-ml/ternary-bonsai-2-9b","crouton-alpha","stealth/crouton-alpha","inkling-2-small","thinkingmachines/inkling-2-small","aion-labs/aion-2.0","aion-2.0","aion-labs/aion-3.0","aion-3.0","aion-labs/aion-3.0-mini","aion-3.0-mini","aion-labs/aion-3.5","aion-3.5","aion-labs/aion-3.5-mini","aion-3.5-mini","alibaba/qwen3-235b-a22b-thinking-2507","qwen3-235b-a22b-thinking-2507","alibaba/qwen3-32b","qwen3-32b","alibaba/qwen3.8-2.4t-a95b","qwen3.8-2.4t-a95b","alibaba/qwen3.8-max-prime","qwen3.8-max-prime","alibaba/qwen3-coder-480b-a35b-instruct","qwen3-coder-480b-a35b-instruct","alibaba/qwen3-max-instruct","alibaba/qwen3-next-80b-a3b-instruct","qwen3-next-80b-a3b-instruct","alibaba/qwen-plus","qwen-plus","amazon/nova-2-lite-v1","nova-2-lite-v1","amazon/nova-lite-v1","nova-lite-v1","amazon/nova-micro-v1","nova-micro-v1","amazon/nova-premier-v1","nova-premier-v1","amazon/nova-pro-v1","nova-pro-v1","baidu/ernie-4.5-vl-424b-a47b","baidu/ernie-4-5-vl-424b-a47b","bytedance-seed/seed-1.6","seed-1.6","bytedance-seed/seed-1.6-flash","seed-1.6-flash","bytedance-seed/seed-2.0-lite","seed-2.0-lite","bytedance-seed/seed-2.0-mini","seed-2.0-mini","bytedance-seed/seed-2-1-turbo","seed-2-1-turbo","cohere/command-a","command-a","cohere/command-r-08-2024","command-r-08-2024","cohere/command-r7b-12-2024","command-r7b-12-2024","cohere/command-r-plus-08-2024","command-r-plus-08-2024","deepseek/deepseek-chat-v3-0324","deepseek/deepseek-chat-v3.1","deepseek/deepseek-non-reasoner-v3.1-terminus","deepseek-non-reasoner-v3.1-terminus","deepseek/deepseek-non-thinking-v3.2-exp","deepseek-non-thinking-v3.2-exp","deepseek/deepseek-reasoner-v3.1-terminus","deepseek-reasoner-v3.1-terminus","deepseek/deepseek-thinking-v3.2-exp","deepseek-thinking-v3.2-exp-v2","deepseek/deepseek-v4.1-flash","deepseek-flash","deepseek-v4.1-flash","deepseek/deepseek-flash","deepseek/deepseek-v4.1-flash-1017","deepseek/deepseek-v4-flash","deepseek-v4-flash","deepseek/deepseek-v4-flash-latest","deepseek-v4-flash-latest","deepseek/deepseek-v4-flash-vision-exp","deepseek-v4-flash-vision-exp","deepseek/deepseek-v4-pro","deepseek-v4-pro","deepseek/deepseek-v4-pro-0813","deepseek-v4-pro-0813","elorian/glimpse","glimpse","fireworks/ember-1","ember-1","google/gemini-2.5-flash","gemini-2.5-flash","google/gemini-2.5-flash-lite","gemini-2.5-flash-lite","google/gemini-2.5-flash-lite-preview","gemini-2.5-flash-lite-preview","google/gemini-2.5-pro","gemini-2.5-pro","google/gemini-2.5-pro-preview","gemini-2.5-pro-preview","google/gemini-3-1-flash-lite","google/gemini-3.1-flash-lite","gemini-3.1-flash-lite","google/gemini-3-1-flash-lite-preview","google/gemini-3.1-flash-lite-preview","gemini-3.1-flash-lite-preview","google/gemini-3.1-pro-preview","gemini-3-1-pro-preview","gemini-3.1-pro-preview","google/gemini-3-1-pro-preview","google/gemini-3.1-pro-preview-customtools","gemini-3.1-pro-preview-customtools","google/gemini-3-5-flash","gemini-3-5-flash","google/gemini-3.5-flash","gemini-3.5-flash","google/gemini-3-5-flash-lite","gemini-3-5-flash-lite","google/gemini-3.5-flash-lite","gemini-3.5-flash-lite","google/gemini-3-6-flash","gemini-3-6-flash","google/gemini-3.6-flash","gemini-3.6-flash","google/gemini-3-7-flash","gemini-3-7-flash","google/gemini-3.7-flash","gemini-3.7-flash","google/gemini-3-8-flash","gemini-3-8-flash","google/gemini-3.8-flash","gemini-3.8-flash","google/gemini-3-flash-preview","gemini-3-flash-preview","google/gemini-3-pro-image","gemini-3-pro-image","google/gemini-3-pro-image-preview","google/gemini-4-argon","gemini-4-argon","google/gemini-4-carbon","gemini-4-carbon","google/gemini-flash-latest","gemini-flash-latest","google/gemini-pro-latest","gemini-pro-latest","google/gemma-4-26b-a4b-it","gemma-4-26b-a4b-it","google/gemma-4-26b-a4b-it-maas","gemma-4-26b-a4b-it-maas","ibm-granite/granite-4.2-8b","granite-4.2-8b","inception/mercury-2","mercury-2","inception/mercury-2.5","mercury-2.5","inclusionai/ling-3.0-flash","inclusionai/ling-3.0-flash:free","ling-3.0-flash","ling-3.0-flash:free","inclusionai/ling-3.0-flash-vl","inclusionai/ling-3.0-flash-vl:free","ling-3.0-flash-vl","ling-3.0-flash-vl:free","inclusionai/ling-3.1-flash","ling-3.1-flash","liquid/lfm-2.5-24b-a2b","lfm-2.5-24b-a2b","meta-llama/Llama-3.3-70B-Instruct-Turbo","meta/muse-glimmer-30b","muse-glimmer-30b","meta/muse-spark-1.1","muse-spark-1.1","meta/muse-spark-1.2","muse-spark-1.2","meta/muse-spark-1.3","muse-spark-1.3","meta/muse-spark-open","muse-spark-open","meta/muse-wonder","muse-wonder","minimax/m1","minimax-m1","minimax/minimax-m3.1-flash","minimax-m3.1-flash","minimax/MiniMax-Text-01","minimax-text-01","mistralai/codestral-2508","codestral-2508","mistralai/devstral-2512","devstral-2512","mistralai/ministral-14b-2512","ministral-14b-2512","mistralai/ministral-3b-2512","ministral-3b-2512","mistralai/ministral-8b-2512","ministral-8b-2512","mistralai/mistral-large","mistral-large","mistralai/mistral-large-2407","mistral-large-2407","mistralai/mistral-large-4-0","mistral-large-4-0","mistral/mistral-large-4-0","mistralai/mistral-medium-3","mistral-medium-3","mistralai/mistral-medium-3.1","mistral-medium-3.1","mistralai/mistral-medium-3-5","mistral-medium-3-5","mistralai/mistral-nemo","mistral-nemo","mistralai/mistral-saba","mistral-saba","mistralai/mistral-small-2603","mistral-small-2603","mistralai/mistral-small-3.1-24b-instruct","mistral-small-3.1-24b-instruct","mistralai/mistral-small-3.2-24b-instruct","mistral-small-3.2-24b-instruct","mistralai/mixtral-8x22b-instruct","mixtral-8x22b-instruct","mistralai/voxtral-small-24b-2507","voxtral-small-24b-2507","moonshotai/kimi-k2","kimi-k2","moonshotai/kimi-k2-0905","kimi-k2-0905","moonshotai/kimi-k2.5","kimi-k2.5","moonshotai/kimi-k2.6","kimi-k2.6","moonshotai/kimi-k2.7-code","kimi-k2.7-code","moonshotai/kimi-k2-thinking","kimi-k2-thinking","moonshotai/kimi-latest","kimi-latest","moonshot/kimi-k3","kimi-k3","moonshotai/kimi-k3","nousresearch/hermes-3-llama-3.1-405b","hermes-3-llama-3.1-405b","nousresearch/hermes-3-llama-3.1-70b","hermes-3-llama-3.1-70b","nvidia/nemotron-3.5-lightning","nemotron-3.5-lightning","nemotron-3.5-lightning:free","nvidia/nemotron-3.5-lightning:free","nvidia/nemotron-3.5-super-vl","nemotron-3.5-super-vl","nvidia/nemotron-3-nano-30b-a3b","nemotron-3-nano-30b-a3b","nvidia/nemotron-3-super-120b-a12b","nemotron-3-super-120b-a12b","nvidia/nemotron-3-ultra-550b-a55b","nemotron-3-ultra-550b-a55b","openai/gpt-3.5-turbo-0613","gpt-3.5-turbo-0613","openai/gpt-4.1","gpt-4.1","openai/gpt-4.1-2025-04-14","gpt-4.1-2025-04-14","openai/gpt-4.1-mini","gpt-4.1-mini","openai/gpt-4.1-mini-2025-04-14","gpt-4.1-mini-2025-04-14","openai/gpt-4o","gpt-4o","openai/gpt-4o-2024-05-13","gpt-4o-2024-05-13","openai/gpt-4o-2024-08-06","gpt-4o-2024-08-06","openai/gpt-4o-2024-11-20","gpt-4o-2024-11-20","openai/gpt-4o-mini","gpt-4o-mini","openai/gpt-4o-mini-2024-07-18","gpt-4o-mini-2024-07-18","openai/gpt-5","gpt-5","openai/gpt-5-1","openai/gpt-5.1","gpt-5.1","openai/gpt-5.1-2025-11-13","gpt-5.1-2025-11-13","openai/gpt-5.1-codex","gpt-5.1-codex","openai/gpt-5.1-codex-max","gpt-5.1-codex-max","openai/gpt-5.1-codex-mini","gpt-5.1-codex-mini","openai/gpt-5-2","openai/gpt-5.2","gpt-5.2","openai/gpt-5-2025-08-07","gpt-5-2025-08-07","openai/gpt-5.2-2025-12-11","gpt-5.2-2025-12-11","openai/gpt-5.2-chat","gpt-5.2-chat","openai/gpt-5.2-codex","gpt-5.2-codex","openai/gpt-5.2-pro","gpt-5.2-pro","openai/gpt-5.3-codex","gpt-5.3-codex","openai/gpt-5.4","gpt-5.4","openai/gpt-5.4-mini","gpt-5.4-mini","openai/gpt-5.4-nano","gpt-5.4-nano","openai/gpt-5.4-pro","gpt-5.4-pro","openai/gpt-5.5","gpt-5.5","openai/gpt-5.5-pro","gpt-5.5-pro","openai/gpt-5.6-luna","gpt-5.6-luna","openai/gpt-5.6-luna-pro","gpt-5.6-luna-pro","openai/gpt-5.6-sol","gpt-5.6-sol","openai/gpt-5.6-sol-pro","gpt-5.6-sol-pro","openai/gpt-5.6-terra","gpt-5.6-terra","openai/gpt-5.6-terra-pro","gpt-5.6-terra-pro","openai/gpt-5-mini","gpt-5-mini","openai/gpt-5-mini-2025-08-07","gpt-5-mini-2025-08-07","openai/gpt-5-nano","gpt-5-nano","openai/gpt-5-nano-2025-08-07","gpt-5-nano-2025-08-07","openai/gpt-5-pro","gpt-5-pro","openai/gpt-6.1-sol","gpt-6.1-sol","openai/gpt-6-astra","gpt-6-astra","openai/gpt-chat-latest","gpt-chat-latest","openai/gpt-latest","gpt-latest","openai/gpt-mini-latest","gpt-mini-latest","openai/gpt-oss-120b","gpt-oss-120b","openai/gpt-oss-20b","gpt-oss-20b","openai/gpt-oss-safeguard-20b","gpt-oss-safeguard-20b","openai/o3","o3","openai/o3-2025-04-16","o3-2025-04-16","openai/o3-pro","o3-pro","perceptron/perceptron-mk1.5","perceptron-mk1.5","poolside/laguna-s-2.1","laguna-s-2.1","poolside/laguna-xs-2.1","laguna-xs-2.1","prism-ml/ternary-bonsai-2-27b","ternary-bonsai-2-27b","reflection/beam-1.0-501b-a23b","beam-1.0-501b-a23b","rekaai/reka-edge","reka-edge","relace/relace-search","relace-search","sakana/fugu-max","fugu-max","sakana/fugu-ultra","fugu-ultra","sakana/fugu-ultra-v2","fugu-ultra-v2","sakana/sakana-namazu","sakana-namazu","stealth/space-bunny-alpha","space-bunny-alpha","stepfun/step-3.7-flash","step-3.7-flash","stepfun/step-5-preview","step-5-preview","tencent/hy3","hy3","tencent/hy4","hy4","tencent/hy4-preview","hy4-preview","thinkingmachines/inkling","inkling","unbiased/pareto","pareto","unbiased/pareto-26.10","pareto-26.10","unbiased/pareto-26.10-preview","pareto-26.10-preview","upstage/solar-mini4","solar-mini4","upstage/solar-pro4","solar-pro4","x-ai/grok-4-20-0309-non-reasoning","grok-4-20-0309-non-reasoning","x-ai/grok-4-20-0309-reasoning","grok-4-20-0309-reasoning","xiaomi/mimo-v2.5","mimo-v2.5","xiaomi/mimo-v2.5-pro","mimo-v2.5-pro","xiaomi/mimo-v2.6-flash","mimo-v2.6-flash","xiaomi/mimo-v2.6-pro","mimo-v2.6-pro","xiaomi/mimo-v2.6-pro-ultraspeed","mimo-v2.6-pro-ultraspeed","z-ai/glm-4.5","z-ai/glm-4.5-air","z-ai/glm-4.5v","glm-4.5v","z-ai/glm-4.6","z-ai/glm-4.6v","glm-4.6v","z-ai/glm-4.7","z-ai/glm-4.7-flash","glm-4.7-flash","z-ai/glm-5","z-ai/glm-5.1","z-ai/glm-5.2","z-ai/glm-5.3","z-ai/glm-5.3-flash","glm-5.3-flash","ox-alpha","stealth/ox-alpha","zhipu/glm-5.3-flash","z-ai/glm-5.3-flashx","glm-5.3-flashx","zhipu/glm-5.3-flashx","z-ai/glm-5-turbo","glm-5-turbo","z-ai/glm-5v-turbo","glm-5v-turbo","zhipu/glm-4.5","glm-4.5","zhipu/glm-4.5-air","glm-4.5-air","zhipu/glm-4.6","glm-4.6","zhipu/glm-4.7","glm-4.7","zhipu/glm-5","glm-5","zhipu/glm-5-1","zhipu/glm-5.1","glm-5.1","zhipu/glm-5-2","zhipu/glm-5.2","glm-5.2","zhipu/glm-5-3","zhipu/glm-5.3","glm-5.3"]},"messages":{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"required":["role","content"]}]},"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."},"max_tokens":{"type":"number","default":1024,"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."},"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."},"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."},"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"]}],"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":{"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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"]}]},"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."},"top_k":{"type":"number","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."},"top_p":{"type":"number","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."},"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"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."}}}},"required":["model","messages"],"title":"gpt-5.4-2026-03-05, openai/gpt-5.4-2026-03-05, gpt-5.5-2026-04-23, openai/gpt-5.5-2026-04-23, gpt-6-sol, openai/gpt-6-sol, gpt-6.1-terra, openai/gpt-6.1-terra, gpt-6-luna, openai/gpt-6-luna, gpt-6.1-terra-pro, openai/gpt-6.1-terra-pro, openai/gpt-5-4, openai/gpt-5-5, bytedance/seed-2-0-pro, bytedance/seed-2-0-code-preview, bytedance/dola-seed-2-0-pro, bytedance/dola-seed-2-0-code, deepseek-chat, deepseek/deepseek-chat, longcat-2.0, meituan/longcat-2.0, gemini-4-hydrogen, google/gemini-4-hydrogen, muse-ember, meta/muse-ember, mistral-large-2512, mistralai/mistral-large-2512, alibaba/glm-5.2, glm-5.2-fast-preview, alibaba/glm-5.2-fast-preview, qwen-max, alibaba/qwen-max, qwen-turbo, alibaba/qwen-turbo, qwen3.5-flash, alibaba/qwen3.5-flash, qwen3.5-plus, alibaba/qwen3.5-plus, qwen3-max-preview, alibaba/qwen3-max-preview, qwen3-max, alibaba/qwen3-max, qwen3-vl-plus, alibaba/qwen3-vl-plus, qwen3-vl-flash, alibaba/qwen3-vl-flash, qwen3-vl-32b-thinking, alibaba/qwen3-vl-32b-thinking, qwen3-vl-32b-instruct, alibaba/qwen3-vl-32b-instruct, qwen3.5-omni-plus, alibaba/qwen3.5-omni-plus, qwen3.5-omni-flash, alibaba/qwen3.5-omni-flash, qwen3.8-omni-flash, alibaba/qwen3.8-omni-flash, qwen3.6-max-preview, alibaba/qwen3.6-max-preview, qwen3.7-max, alibaba/qwen3.7-max, qwen3.8-max, alibaba/qwen3.8-max, qwen4-max, alibaba/qwen4-max, qwen3.8-flash, alibaba/qwen3.8-flash, qwen3.7-plus, alibaba/qwen3.7-plus, qwen3.6-plus, alibaba/qwen3.6-plus, qwen3.6-flash, alibaba/qwen3.6-flash, qwen3.6-27b, alibaba/qwen3.6-27b, qwen3.6-35b-a3b, alibaba/qwen3.6-35b-a3b, zhipu/glm-5-2-fast-preview, alibaba/qwen3.5-plus-20260218, minimax/m2, MiniMax-M2, minimax/m2-1, MiniMax-M2.1, minimax/m2-1-highspeed, MiniMax-M2.1-Highspeed, minimax/m2-5-20260218, MiniMax-M2.5, minimax/minimax-m3, MiniMax-M3, minimax/m2-7-20260402, MiniMax-M2.7, minimax/m2-7-highspeed, MiniMax-M2.7-Highspeed, minimax/m2-5-highspeed-20260218, MiniMax-M2.5-Highspeed, moonshot/kimi-k2-5, kimi-k2-5, moonshot/kimi-k2-6, moonshot/kimi-k2-7-code, kimi-k2-7-code, moonshot/kimi-k2-7-code-highspeed, kimi-k2-7-code-highspeed, moonshot/kimi-k3-1-pro, moonshot/kimi-k3.1-pro, moonshot/kimi-k3-1-pro-highspeed, moonshot/kimi-k3.1-pro-highspeed, ernie-5.0, baidu/ernie-5.0, baidu/ernie-5.5-flash-preview, ernie-5.5-flash-preview, x-ai/grok-3-beta, grok-3, x-ai/grok-3-mini-beta, grok-3-mini, grok-4-fast-reasoning, x-ai/grok-4-fast-reasoning, grok-4-fast-non-reasoning, x-ai/grok-4-fast-non-reasoning, grok-4-1-fast-reasoning, x-ai/grok-4-1-fast-reasoning, grok-4-1-fast-non-reasoning, x-ai/grok-4-1-fast-non-reasoning, x-ai/grok-4-3, grok-4-3, x-ai/grok-4-5, grok-4-5, x-ai/grok-4-6, grok-4-6, x-ai/grok-4-7, grok-4-7, x-ai/grok-code-fast-1, grok-code-fast-1, xai/grok-build-0-1, x-ai/grok-build-0-1, grok-build-0-1, labs-leanstral-1-5, mistral/labs-leanstral-1-5, leanstral-1-5, mistral/leanstral-1-5, mercury-3, inception/mercury-3, ling-3.0-tiny, inclusionai/ling-3.0-tiny, ternary-bonsai-2-9b, prism-ml/ternary-bonsai-2-9b, crouton-alpha, stealth/crouton-alpha, inkling-2-small, thinkingmachines/inkling-2-small, aion-labs/aion-2.0, aion-2.0, aion-labs/aion-3.0, aion-3.0, aion-labs/aion-3.0-mini, aion-3.0-mini, aion-labs/aion-3.5, aion-3.5, aion-labs/aion-3.5-mini, aion-3.5-mini, alibaba/qwen3-235b-a22b-thinking-2507, qwen3-235b-a22b-thinking-2507, alibaba/qwen3-32b, qwen3-32b, alibaba/qwen3.8-2.4t-a95b, qwen3.8-2.4t-a95b, alibaba/qwen3.8-max-prime, qwen3.8-max-prime, alibaba/qwen3-coder-480b-a35b-instruct, qwen3-coder-480b-a35b-instruct, alibaba/qwen3-max-instruct, alibaba/qwen3-next-80b-a3b-instruct, qwen3-next-80b-a3b-instruct, alibaba/qwen-plus, qwen-plus, amazon/nova-2-lite-v1, nova-2-lite-v1, amazon/nova-lite-v1, nova-lite-v1, amazon/nova-micro-v1, nova-micro-v1, amazon/nova-premier-v1, nova-premier-v1, amazon/nova-pro-v1, nova-pro-v1, baidu/ernie-4.5-vl-424b-a47b, baidu/ernie-4-5-vl-424b-a47b, bytedance-seed/seed-1.6, seed-1.6, bytedance-seed/seed-1.6-flash, seed-1.6-flash, bytedance-seed/seed-2.0-lite, seed-2.0-lite, bytedance-seed/seed-2.0-mini, seed-2.0-mini, bytedance-seed/seed-2-1-turbo, seed-2-1-turbo, cohere/command-a, command-a, cohere/command-r-08-2024, command-r-08-2024, cohere/command-r7b-12-2024, command-r7b-12-2024, cohere/command-r-plus-08-2024, command-r-plus-08-2024, deepseek/deepseek-chat-v3-0324, deepseek/deepseek-chat-v3.1, deepseek/deepseek-non-reasoner-v3.1-terminus, deepseek-non-reasoner-v3.1-terminus, deepseek/deepseek-non-thinking-v3.2-exp, deepseek-non-thinking-v3.2-exp, deepseek/deepseek-reasoner-v3.1-terminus, deepseek-reasoner-v3.1-terminus, deepseek/deepseek-thinking-v3.2-exp, deepseek-thinking-v3.2-exp-v2, deepseek/deepseek-v4.1-flash, deepseek-flash, deepseek-v4.1-flash, deepseek/deepseek-flash, deepseek/deepseek-v4.1-flash-1017, deepseek/deepseek-v4-flash, deepseek-v4-flash, deepseek/deepseek-v4-flash-latest, deepseek-v4-flash-latest, deepseek/deepseek-v4-flash-vision-exp, deepseek-v4-flash-vision-exp, deepseek/deepseek-v4-pro, deepseek-v4-pro, deepseek/deepseek-v4-pro-0813, deepseek-v4-pro-0813, elorian/glimpse, glimpse, fireworks/ember-1, ember-1, google/gemini-2.5-flash, gemini-2.5-flash, google/gemini-2.5-flash-lite, gemini-2.5-flash-lite, google/gemini-2.5-flash-lite-preview, gemini-2.5-flash-lite-preview, google/gemini-2.5-pro, gemini-2.5-pro, google/gemini-2.5-pro-preview, gemini-2.5-pro-preview, google/gemini-3-1-flash-lite, google/gemini-3.1-flash-lite, gemini-3.1-flash-lite, google/gemini-3-1-flash-lite-preview, google/gemini-3.1-flash-lite-preview, gemini-3.1-flash-lite-preview, google/gemini-3.1-pro-preview, gemini-3-1-pro-preview, gemini-3.1-pro-preview, google/gemini-3-1-pro-preview, google/gemini-3.1-pro-preview-customtools, gemini-3.1-pro-preview-customtools, google/gemini-3-5-flash, gemini-3-5-flash, google/gemini-3.5-flash, gemini-3.5-flash, google/gemini-3-5-flash-lite, gemini-3-5-flash-lite, google/gemini-3.5-flash-lite, gemini-3.5-flash-lite, google/gemini-3-6-flash, gemini-3-6-flash, google/gemini-3.6-flash, gemini-3.6-flash, google/gemini-3-7-flash, gemini-3-7-flash, google/gemini-3.7-flash, gemini-3.7-flash, google/gemini-3-8-flash, gemini-3-8-flash, google/gemini-3.8-flash, gemini-3.8-flash, google/gemini-3-flash-preview, gemini-3-flash-preview, google/gemini-3-pro-image, gemini-3-pro-image, google/gemini-3-pro-image-preview, google/gemini-4-argon, gemini-4-argon, google/gemini-4-carbon, gemini-4-carbon, google/gemini-flash-latest, gemini-flash-latest, google/gemini-pro-latest, gemini-pro-latest, google/gemma-4-26b-a4b-it, gemma-4-26b-a4b-it, google/gemma-4-26b-a4b-it-maas, gemma-4-26b-a4b-it-maas, ibm-granite/granite-4.2-8b, granite-4.2-8b, inception/mercury-2, mercury-2, inception/mercury-2.5, mercury-2.5, inclusionai/ling-3.0-flash, inclusionai/ling-3.0-flash:free, ling-3.0-flash, ling-3.0-flash:free, inclusionai/ling-3.0-flash-vl, inclusionai/ling-3.0-flash-vl:free, ling-3.0-flash-vl, ling-3.0-flash-vl:free, inclusionai/ling-3.1-flash, ling-3.1-flash, liquid/lfm-2.5-24b-a2b, lfm-2.5-24b-a2b, meta-llama/Llama-3.3-70B-Instruct-Turbo, meta/muse-glimmer-30b, muse-glimmer-30b, meta/muse-spark-1.1, muse-spark-1.1, meta/muse-spark-1.2, muse-spark-1.2, meta/muse-spark-1.3, muse-spark-1.3, meta/muse-spark-open, muse-spark-open, meta/muse-wonder, muse-wonder, minimax/m1, minimax-m1, minimax/minimax-m3.1-flash, minimax-m3.1-flash, minimax/MiniMax-Text-01, minimax-text-01, mistralai/codestral-2508, codestral-2508, mistralai/devstral-2512, devstral-2512, mistralai/ministral-14b-2512, ministral-14b-2512, mistralai/ministral-3b-2512, ministral-3b-2512, mistralai/ministral-8b-2512, ministral-8b-2512, mistralai/mistral-large, mistral-large, mistralai/mistral-large-2407, mistral-large-2407, mistralai/mistral-large-4-0, mistral-large-4-0, mistral/mistral-large-4-0, mistralai/mistral-medium-3, mistral-medium-3, mistralai/mistral-medium-3.1, mistral-medium-3.1, mistralai/mistral-medium-3-5, mistral-medium-3-5, mistralai/mistral-nemo, mistral-nemo, mistralai/mistral-saba, mistral-saba, mistralai/mistral-small-2603, mistral-small-2603, mistralai/mistral-small-3.1-24b-instruct, mistral-small-3.1-24b-instruct, mistralai/mistral-small-3.2-24b-instruct, mistral-small-3.2-24b-instruct, mistralai/mixtral-8x22b-instruct, mixtral-8x22b-instruct, mistralai/voxtral-small-24b-2507, voxtral-small-24b-2507, moonshotai/kimi-k2, kimi-k2, moonshotai/kimi-k2-0905, kimi-k2-0905, moonshotai/kimi-k2.5, kimi-k2.5, moonshotai/kimi-k2.6, kimi-k2.6, moonshotai/kimi-k2.7-code, kimi-k2.7-code, moonshotai/kimi-k2-thinking, kimi-k2-thinking, moonshotai/kimi-latest, kimi-latest, moonshot/kimi-k3, kimi-k3, moonshotai/kimi-k3, nousresearch/hermes-3-llama-3.1-405b, hermes-3-llama-3.1-405b, nousresearch/hermes-3-llama-3.1-70b, hermes-3-llama-3.1-70b, nvidia/nemotron-3.5-lightning, nemotron-3.5-lightning, nemotron-3.5-lightning:free, nvidia/nemotron-3.5-lightning:free, nvidia/nemotron-3.5-super-vl, nemotron-3.5-super-vl, nvidia/nemotron-3-nano-30b-a3b, nemotron-3-nano-30b-a3b, nvidia/nemotron-3-super-120b-a12b, nemotron-3-super-120b-a12b, nvidia/nemotron-3-ultra-550b-a55b, nemotron-3-ultra-550b-a55b, openai/gpt-3.5-turbo-0613, gpt-3.5-turbo-0613, openai/gpt-4.1, gpt-4.1, openai/gpt-4.1-2025-04-14, gpt-4.1-2025-04-14, openai/gpt-4.1-mini, gpt-4.1-mini, openai/gpt-4.1-mini-2025-04-14, gpt-4.1-mini-2025-04-14, openai/gpt-4o, gpt-4o, openai/gpt-4o-2024-05-13, gpt-4o-2024-05-13, openai/gpt-4o-2024-08-06, gpt-4o-2024-08-06, openai/gpt-4o-2024-11-20, gpt-4o-2024-11-20, openai/gpt-4o-mini, gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, gpt-4o-mini-2024-07-18, openai/gpt-5, gpt-5, openai/gpt-5-1, openai/gpt-5.1, gpt-5.1, openai/gpt-5.1-2025-11-13, gpt-5.1-2025-11-13, openai/gpt-5.1-codex, gpt-5.1-codex, openai/gpt-5.1-codex-max, gpt-5.1-codex-max, openai/gpt-5.1-codex-mini, gpt-5.1-codex-mini, openai/gpt-5-2, openai/gpt-5.2, gpt-5.2, openai/gpt-5-2025-08-07, gpt-5-2025-08-07, openai/gpt-5.2-2025-12-11, gpt-5.2-2025-12-11, openai/gpt-5.2-chat, gpt-5.2-chat, openai/gpt-5.2-codex, gpt-5.2-codex, openai/gpt-5.2-pro, gpt-5.2-pro, openai/gpt-5.3-codex, gpt-5.3-codex, openai/gpt-5.4, gpt-5.4, openai/gpt-5.4-mini, gpt-5.4-mini, openai/gpt-5.4-nano, gpt-5.4-nano, openai/gpt-5.4-pro, gpt-5.4-pro, openai/gpt-5.5, gpt-5.5, openai/gpt-5.5-pro, gpt-5.5-pro, openai/gpt-5.6-luna, gpt-5.6-luna, openai/gpt-5.6-luna-pro, gpt-5.6-luna-pro, openai/gpt-5.6-sol, gpt-5.6-sol, openai/gpt-5.6-sol-pro, gpt-5.6-sol-pro, openai/gpt-5.6-terra, gpt-5.6-terra, openai/gpt-5.6-terra-pro, gpt-5.6-terra-pro, openai/gpt-5-mini, gpt-5-mini, openai/gpt-5-mini-2025-08-07, gpt-5-mini-2025-08-07, openai/gpt-5-nano, gpt-5-nano, openai/gpt-5-nano-2025-08-07, gpt-5-nano-2025-08-07, openai/gpt-5-pro, gpt-5-pro, openai/gpt-6.1-sol, gpt-6.1-sol, openai/gpt-6-astra, gpt-6-astra, openai/gpt-chat-latest, gpt-chat-latest, openai/gpt-latest, gpt-latest, openai/gpt-mini-latest, gpt-mini-latest, openai/gpt-oss-120b, gpt-oss-120b, openai/gpt-oss-20b, gpt-oss-20b, openai/gpt-oss-safeguard-20b, gpt-oss-safeguard-20b, openai/o3, o3, openai/o3-2025-04-16, o3-2025-04-16, openai/o3-pro, o3-pro, perceptron/perceptron-mk1.5, perceptron-mk1.5, poolside/laguna-s-2.1, laguna-s-2.1, poolside/laguna-xs-2.1, laguna-xs-2.1, prism-ml/ternary-bonsai-2-27b, ternary-bonsai-2-27b, reflection/beam-1.0-501b-a23b, beam-1.0-501b-a23b, rekaai/reka-edge, reka-edge, relace/relace-search, relace-search, sakana/fugu-max, fugu-max, sakana/fugu-ultra, fugu-ultra, sakana/fugu-ultra-v2, fugu-ultra-v2, sakana/sakana-namazu, sakana-namazu, stealth/space-bunny-alpha, space-bunny-alpha, stepfun/step-3.7-flash, step-3.7-flash, stepfun/step-5-preview, step-5-preview, tencent/hy3, hy3, tencent/hy4, hy4, tencent/hy4-preview, hy4-preview, thinkingmachines/inkling, inkling, unbiased/pareto, pareto, unbiased/pareto-26.10, pareto-26.10, unbiased/pareto-26.10-preview, pareto-26.10-preview, upstage/solar-mini4, solar-mini4, upstage/solar-pro4, solar-pro4, x-ai/grok-4-20-0309-non-reasoning, grok-4-20-0309-non-reasoning, x-ai/grok-4-20-0309-reasoning, grok-4-20-0309-reasoning, xiaomi/mimo-v2.5, mimo-v2.5, xiaomi/mimo-v2.5-pro, mimo-v2.5-pro, xiaomi/mimo-v2.6-flash, mimo-v2.6-flash, xiaomi/mimo-v2.6-pro, mimo-v2.6-pro, xiaomi/mimo-v2.6-pro-ultraspeed, mimo-v2.6-pro-ultraspeed, z-ai/glm-4.5, z-ai/glm-4.5-air, z-ai/glm-4.5v, glm-4.5v, z-ai/glm-4.6, z-ai/glm-4.6v, glm-4.6v, z-ai/glm-4.7, z-ai/glm-4.7-flash, glm-4.7-flash, z-ai/glm-5, z-ai/glm-5.1, z-ai/glm-5.2, z-ai/glm-5.3, z-ai/glm-5.3-flash, glm-5.3-flash, ox-alpha, stealth/ox-alpha, zhipu/glm-5.3-flash, z-ai/glm-5.3-flashx, glm-5.3-flashx, zhipu/glm-5.3-flashx, z-ai/glm-5-turbo, glm-5-turbo, z-ai/glm-5v-turbo, glm-5v-turbo, zhipu/glm-4.5, glm-4.5, zhipu/glm-4.5-air, glm-4.5-air, zhipu/glm-4.6, glm-4.6, zhipu/glm-4.7, glm-4.7, zhipu/glm-5, glm-5, zhipu/glm-5-1, zhipu/glm-5.1, glm-5.1, zhipu/glm-5-2, zhipu/glm-5.2, glm-5.2, zhipu/glm-5-3, zhipu/glm-5.3, glm-5.3"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"messages":{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"required":["role","content"]}]},"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."},"max_tokens":{"type":"number","default":1024,"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."},"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."},"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."},"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"]}],"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":{"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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"]}]},"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."},"top_k":{"type":"number","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."},"top_p":{"type":"number","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."},"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"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."}}},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"How much the model spends on the whole response: thinking, text and tool calls. `low` is the fastest and cheapest, `max` the most thorough. When omitted, the model uses its own default level. `none` selects the least reasoning the model allows: it turns thinking off where the model supports that, and sends `low` where thinking cannot be switched off."}},"description":"Output configuration. `effort` controls reasoning depth and total token spend; use it instead of `thinking.budget_tokens` on models with adaptive thinking."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"messages":{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"required":["role","content"]}]},"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."},"max_tokens":{"type":"number","default":1024,"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."},"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."},"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."},"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"]}],"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":{"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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"]}]},"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."},"top_k":{"type":"number","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."},"top_p":{"type":"number","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."},"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"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."}}},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"How much the model spends on the whole response: thinking, text and tool calls. `low` is the fastest and cheapest, `max` the most thorough. When omitted, the model uses its own default level. `none` selects the least reasoning the model allows: it turns thinking off where the model supports that, and sends `low` where thinking cannot be switched off."}},"description":"Output configuration. `effort` controls reasoning depth and total token spend; use it instead of `thinking.budget_tokens` on models with adaptive thinking."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"messages":{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"required":["role","content"]}]},"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."},"max_tokens":{"type":"number","default":1024,"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."},"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."},"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."},"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"]}],"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":{"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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"]}]},"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."},"top_k":{"type":"number","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."},"top_p":{"type":"number","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."},"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"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."}}},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"messages":{"anyOf":[{"type":"array","items":{"oneOf":[{"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":{"nullable":true}}]}},"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":{"nullable":true}},"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":{"nullable":true}},"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":{"nullable":true}}]}},"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":{"nullable":true}}]}},"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":"object","properties":{"role":{"type":"string","enum":["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"]}}]}},"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","nullable":true,"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."},{"nullable":true}],"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":{"nullable":true},"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":{"nullable":true},"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","nullable":true,"description":"The refusal message by the Assistant."},"audio":{"type":"object","nullable":true,"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.\n- auto allows the model to pick from among the allowed tools and generate a message.\n- required requires the model to call one or more of the allowed tools."},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"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":{"nullable":true},"required":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":{"nullable":true},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true}}},"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":{"nullable":true,"description":"The parameters the functions accepts, described as a JSON Schema object."}},"strict":{"type":"boolean","nullable":true,"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."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high","xhigh","max"],"description":"How much the model spends on the whole response: thinking, text and tool calls. `low` is the fastest and cheapest, `max` the most thorough. When omitted, the model uses its own default level. `none` selects the least reasoning the model allows: it turns thinking off where the model supports that, and sends `low` where thinking cannot be switched off."}},"description":"Output configuration. `effort` controls reasoning depth and total token spend; use it instead of `thinking.budget_tokens` on models with adaptive thinking."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}}},"required":["model","messages"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"object","nullable":true,"properties":{"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}},"text/event-stream":{"schema":{"type":"object","properties":{"meta":{"type":"object","nullable":true,"properties":{"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}}}}}}}}},"/v1/batches":{"post":{"operationId":"_v1_batches","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","title":"Batch from an input file","required":["input_file_id","endpoint","completion_window"],"properties":{"input_file_id":{"type":"string","description":"A JSONL file uploaded with purpose `batch`, one model per file."},"endpoint":{"type":"string","enum":["/v1/chat/completions"]},"completion_window":{"type":"string","enum":["24h"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"webhook_url":{"type":"string","format":"uri","description":"Optional public https address (port 443 or 8443) that receives a signed batch.completed, batch.failed, batch.cancelled or batch.expired event. The workspace needs a webhook signing secret."}}},{"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-7","anthropic/claude-opus-4-7","claude-opus-4-8","anthropic/claude-opus-4-8","claude-opus-5","anthropic/claude-opus-5","claude-fable-5-1","anthropic/claude-fable-5-1","claude-opus-5-5","anthropic/claude-opus-5-5","claude-sonnet-5-5","anthropic/claude-sonnet-5-5","claude-haiku-5-5","anthropic/claude-haiku-5-5","claude-fable-5-2","anthropic/claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6","anthropic/claude-sonnet-5","claude-sonnet-5"]},"requests":{"type":"array","items":{"type":"object","properties":{"custom_id":{"type":"string"},"params":{"type":"object","properties":{"model":{"type":"string"},"max_tokens":{"type":"number","minimum":1,"default":1024},"messages":{"type":"array","items":{"nullable":true}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"stop_sequences":{"type":"array","items":{"type":"string"}},"system":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":1,"default":1},"tool_choice":{"nullable":true},"tools":{"type":"array","items":{"nullable":true}},"top_k":{"type":"number"},"top_p":{"type":"number"},"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"]}]}},"required":["model","messages"]}},"required":["custom_id","params"]},"minItems":1,"maxItems":100000}},"required":["model","requests"],"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-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-opus-5, anthropic/claude-opus-5, claude-fable-5-1, anthropic/claude-fable-5-1, claude-opus-5-5, anthropic/claude-opus-5-5, claude-sonnet-5-5, anthropic/claude-sonnet-5-5, claude-haiku-5-5, anthropic/claude-haiku-5-5, claude-fable-5-2, anthropic/claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6, anthropic/claude-sonnet-5, claude-sonnet-5","deprecated":true}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"batch_V1StGXR8_Z5jdHi6B-myT"},"object":{"type":"string","enum":["batch"]},"endpoint":{"type":"string","enum":["/v1/chat/completions"]},"model":{"type":"string"},"errors":{"type":"object","nullable":true,"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string","nullable":true},"line":{"type":"integer","nullable":true}}}}}},"input_file_id":{"type":"string"},"completion_window":{"type":"string","enum":["24h"]},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"]},"output_file_id":{"type":"string","nullable":true},"error_file_id":{"type":"string","nullable":true},"created_at":{"type":"integer"},"in_progress_at":{"type":"integer","nullable":true},"expires_at":{"type":"integer"},"finalizing_at":{"type":"integer","nullable":true},"completed_at":{"type":"integer","nullable":true},"failed_at":{"type":"integer","nullable":true},"expired_at":{"type":"integer","nullable":true},"cancelling_at":{"type":"integer","nullable":true},"cancelled_at":{"type":"integer","nullable":true},"request_counts":{"type":"object","description":"Expired and cancelled lines count as failed.","properties":{"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}},"usage":{"type":"object","nullable":true,"properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"output_tokens":{"type":"integer"},"output_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}},"total_tokens":{"type":"integer"}}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"402":{"description":"Not enough balance to hold the worst case of the batch","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"429":{"description":"A limit on active batches, lines or open uploads; see `Retry-After`","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}},"summary":"Create a batch","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional, up to 255 characters. The same key with the same request answers the batch it created. Keys are unique per user across all workspaces: a key already taken by another request, in this workspace or another, answers 409 idempotency_key_reused.","schema":{"type":"string"}}]},"get":{"operationId":"_v1_batches_list","summary":"List your batches of the input-file format, newest first","parameters":[{"name":"after","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"batch_V1StGXR8_Z5jdHi6B-myT"},"object":{"type":"string","enum":["batch"]},"endpoint":{"type":"string","enum":["/v1/chat/completions"]},"model":{"type":"string"},"errors":{"type":"object","nullable":true,"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string","nullable":true},"line":{"type":"integer","nullable":true}}}}}},"input_file_id":{"type":"string"},"completion_window":{"type":"string","enum":["24h"]},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"]},"output_file_id":{"type":"string","nullable":true},"error_file_id":{"type":"string","nullable":true},"created_at":{"type":"integer"},"in_progress_at":{"type":"integer","nullable":true},"expires_at":{"type":"integer"},"finalizing_at":{"type":"integer","nullable":true},"completed_at":{"type":"integer","nullable":true},"failed_at":{"type":"integer","nullable":true},"expired_at":{"type":"integer","nullable":true},"cancelling_at":{"type":"integer","nullable":true},"cancelled_at":{"type":"integer","nullable":true},"request_counts":{"type":"object","description":"Expired and cancelled lines count as failed.","properties":{"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}},"usage":{"type":"object","nullable":true,"properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"output_tokens":{"type":"integer"},"output_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}},"total_tokens":{"type":"integer"}}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}}}}},"has_more":{"type":"boolean"},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}},"description":"With `batch_id`, `id` or `generation_id` this is the deprecated lookup of the inline format."}},"/v1/batches/cancel/:batch_id":{"post":{"operationId":"_v1_batches_cancel_:batch_id","requestBody":{"required":true,"content":{"application/json":{"schema":{"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-7","anthropic/claude-opus-4-7","claude-opus-4-8","anthropic/claude-opus-4-8","claude-opus-5","anthropic/claude-opus-5","claude-fable-5-1","anthropic/claude-fable-5-1","claude-opus-5-5","anthropic/claude-opus-5-5","claude-sonnet-5-5","anthropic/claude-sonnet-5-5","claude-haiku-5-5","anthropic/claude-haiku-5-5","claude-fable-5-2","anthropic/claude-fable-5-2","anthropic/claude-fable-5.1","anthropic/claude-opus-5.5","anthropic/claude-sonnet-5.5","anthropic/claude-haiku-5.5","anthropic/claude-fable-5.2","anthropic/claude-fable-5","claude-fable-5","anthropic/claude-haiku-4.5","claude-haiku-4-5","claude-haiku-4.5","anthropic/claude-opus-4.1","anthropic/claude-opus-4.1-20250805","claude-opus-4-1","claude-opus-4-1-latest","claude-opus-4.1","anthropic/claude-opus-4.5","anthropic/claude-opus-4-5","claude-opus-4-5","claude-opus-4.5","anthropic/claude-opus-4.7","claude-opus-4.7","anthropic/claude-opus-4.8","claude-opus-4.8","anthropic/claude-sonnet-4.5","claude-sonnet-4-5","claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4-6-20260218","claude-sonnet-4.6","anthropic/claude-sonnet-5","claude-sonnet-5"]},"id":{"type":"string"}},"required":["model","id"],"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-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-opus-5, anthropic/claude-opus-5, claude-fable-5-1, anthropic/claude-fable-5-1, claude-opus-5-5, anthropic/claude-opus-5-5, claude-sonnet-5-5, anthropic/claude-sonnet-5-5, claude-haiku-5-5, anthropic/claude-haiku-5-5, claude-fable-5-2, anthropic/claude-fable-5-2, anthropic/claude-fable-5.1, anthropic/claude-opus-5.5, anthropic/claude-sonnet-5.5, anthropic/claude-haiku-5.5, anthropic/claude-fable-5.2, anthropic/claude-fable-5, claude-fable-5, anthropic/claude-haiku-4.5, claude-haiku-4-5, claude-haiku-4.5, anthropic/claude-opus-4.1, anthropic/claude-opus-4.1-20250805, claude-opus-4-1, claude-opus-4-1-latest, claude-opus-4.1, anthropic/claude-opus-4.5, anthropic/claude-opus-4-5, claude-opus-4-5, claude-opus-4.5, anthropic/claude-opus-4.7, claude-opus-4.7, anthropic/claude-opus-4.8, claude-opus-4.8, anthropic/claude-sonnet-4.5, claude-sonnet-4-5, claude-sonnet-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4-6-20260218, claude-sonnet-4.6, anthropic/claude-sonnet-5, claude-sonnet-5"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}}},"deprecated":true}},"/v2/video/generations":{"post":{"operationId":"_v2_video_generations","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedance-1-0-pro","bytedance/seedance-1-0-pro-fast","bytedance/seedance-1-0-pro-t2v","bytedance/seedance-1-0-pro-i2v"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10]},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"camerafixed":{"type":"boolean","default":false,"description":"Whether to fix the camera position.\n- true: Fix the camera position. The platform will append instructions to fix the camera position in the user's prompt, but the actual effect is not guaranteed.\n- false: Do not fix the camera position."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/seedance-1-0-pro, bytedance/seedance-1-0-pro-fast, bytedance/seedance-1-0-pro-t2v, bytedance/seedance-1-0-pro-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedance-1-5-pro"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"aspect_ratio":{"type":"string","enum":["16:9","4:3","1:1","3:4","9:16","21:9","adaptive"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12]},"seed":{"type":"integer","default":-1,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"camera_fixed":{"type":"boolean","default":false,"description":"Whether to fix the camera position.\n- true: Fix the camera position. The platform will append instructions to fix the camera position in the user's prompt, but the actual effect is not guaranteed.\n- false: Do not fix the camera position."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/seedance-1-5-pro"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/dreamina-seedance-2-0","bytedance/seedance-2-0","bytedance/seedance-2.0/image-to-video","bytedance/seedance-2.0/reference-to-video","bytedance/seedance-2.0/text-to-video"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. `auto` (default) uses the full Tencent Cloud VOD -> native ByteDance -> fal.ai chain. `tencent_vod` is the only provider that accepts reference images containing real people (it registers them as assets first); pinning `bytedance` or `fal` sends the images straight to a provider that rejects them with \"the input image may contain real person\". Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p","1080p","4k"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/dreamina-seedance-2-0, bytedance/seedance-2-0, bytedance/seedance-2.0/image-to-video, bytedance/seedance-2.0/reference-to-video, bytedance/seedance-2.0/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/dreamina-seedance-2-0-fast","bytedance/dreamina-seedance-2-0-mini","bytedance/seedance-2-0-fast","bytedance/seedance-2.0/fast/image-to-video","bytedance/seedance-2.0/fast/reference-to-video","bytedance/seedance-2.0/fast/text-to-video","bytedance/seedance-2-0-mini"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. `auto` (default) uses the full Tencent Cloud VOD -> native ByteDance -> fal.ai chain. `tencent_vod` is the only provider that accepts reference images containing real people (it registers them as assets first); pinning `bytedance` or `fal` sends the images straight to a provider that rejects them with \"the input image may contain real person\". Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/dreamina-seedance-2-0-fast, bytedance/dreamina-seedance-2-0-mini, bytedance/seedance-2-0-fast, bytedance/seedance-2.0/fast/image-to-video, bytedance/seedance-2.0/fast/reference-to-video, bytedance/seedance-2.0/fast/text-to-video, bytedance/seedance-2-0-mini"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/dreamina-seedance-2-5","bytedance/seedance-2-5","bytedance/seedance-2.5"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. Seedance 2.5 runs on native ByteDance only, so `auto` (default) and `bytedance` behave identically today. Unlike Seedance 2.0 there is no Tencent Cloud VOD link, so reference images containing real people are rejected upstream. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"task_type":{"type":"string","enum":["auto","reference","edit","extend"],"default":"auto","description":"The Seedance 2.5 task to run with reference media. `edit` changes the source video in `video_url` or `video_urls` and keeps its length and aspect ratio. `extend` continues the source video and keeps its aspect ratio. `reference` makes a new video from the references. With `auto` the model infers the task from the prompt, and an edit or extension sent with a fixed `duration` or `aspect_ratio` fails after it is queued. Refer to the source video in the prompt, for example \"Video edit: remove the car from @Video1\"."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16","adaptive"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests and to `adaptive` for edit and extend tasks (`task_type`), which accept only `adaptive`. With `adaptive` in other requests the model picks the ratio. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds. Set -1 to let the model choose it. An edit (`task_type: edit`) accepts only -1, its default, and keeps the length of the source video.","enum":[-1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/dreamina-seedance-2-5, bytedance/seedance-2-5, bytedance/seedance-2.5"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedance-2-0-fast","bytedance/seedance-2.0/fast/image-to-video","bytedance/seedance-2.0/fast/reference-to-video","bytedance/seedance-2.0/fast/text-to-video","bytedance/seedance-2-0","bytedance/seedance-2.0/image-to-video","bytedance/seedance-2.0/reference-to-video","bytedance/seedance-2.0/text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `bytedance` runs native ByteDance with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the ByteDance -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"bytedance/seedance-2-0-fast, bytedance/seedance-2.0/fast/image-to-video, bytedance/seedance-2.0/fast/reference-to-video, bytedance/seedance-2.0/fast/text-to-video, bytedance/seedance-2-0, bytedance/seedance-2.0/image-to-video, bytedance/seedance-2.0/reference-to-video, bytedance/seedance-2.0/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["veo-3.1-lite-generate-001","google/veo-3.1-lite-generate-001","google/veo-3-1-lite-generate-preview"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720P","1080P"],"default":"720P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"veo-3.1-lite-generate-001, google/veo-3.1-lite-generate-001, google/veo-3-1-lite-generate-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["veo-3.1-generate-001","google/veo-3.1-generate-001","veo-3.1-fast-generate-001","google/veo-3.1-fast-generate-001","google/veo-3.1-t2v","google/veo-3.1-i2v","google/veo-3.1-t2v-fast","google/veo-3.1-i2v-fast","google/veo-3.1-first-last-image-to-video","google/veo-3.1-first-last-image-to-video-fast","google/veo3-1-extend-video","google/veo3-1-fast-extend-video"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution."},"video_url":{"type":"string","format":"uri","description":"URL of a Veo-generated MP4 to extend. Extension output is always 7 seconds; `duration` is forced to 7 when this field is set."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720P","1080P","4K"],"default":"720P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. When `video_url` is set (video extension), Google always returns a fixed 7-second extension; `duration` is forced to 7 and other values are ignored.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"veo-3.1-generate-001, google/veo-3.1-generate-001, veo-3.1-fast-generate-001, google/veo-3.1-fast-generate-001, google/veo-3.1-t2v, google/veo-3.1-i2v, google/veo-3.1-t2v-fast, google/veo-3.1-i2v-fast, google/veo-3.1-first-last-image-to-video, google/veo-3.1-first-last-image-to-video-fast, google/veo3-1-extend-video, google/veo3-1-fast-extend-video"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-omni-flash-preview","google/gemini-omni-flash-preview"]},"prompt":{"type":"string","minLength":1,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"Image URL, gs:// URI, or base64 data URI. Used as the first frame for image_to_video unless the prompt tags it as a reference."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6,"description":"Reference image URLs, gs:// URIs, or base64 data URIs. Use prompt tags such as <IMAGE_REF_0> to bind image roles."},"video_url":{"type":"string","format":"uri","description":"Video URL, gs:// URI, or base64 data URI for edit workflows."},"audio_url":{"type":"string","format":"uri","description":"Audio URL, gs:// URI, or base64 data URI for multimodal prompting."},"previous_interaction_id":{"type":"string","description":"Gemini Interactions API id from a previous Omni generation, used for conversational edits."},"task":{"type":"string","enum":["text_to_video","image_to_video","reference_to_video","edit"],"description":"Gemini Omni video task. Defaults are inferred from the supplied media inputs."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"delivery":{"type":"string","enum":["uri"],"default":"uri","description":"Gemini Omni video response delivery mode."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-omni-flash-preview, google/gemini-omni-flash-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-omni-1.1-flash","google/gemini-omni-1.1-flash"]},"prompt":{"type":"string","minLength":1,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"Image URL, gs:// URI, or base64 data URI. Used as the first frame for image_to_video unless the prompt tags it as a reference."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6,"description":"Reference image URLs, gs:// URIs, or base64 data URIs. Use prompt tags such as <IMAGE_REF_0> to bind image roles. Pass exactly two images with task=image_to_video for first/last frame interpolation."},"video_url":{"type":"string","format":"uri","description":"Video URL, gs:// URI, or base64 data URI for edit and extend workflows."},"audio_url":{"type":"string","format":"uri","description":"Audio URL, gs:// URI, or base64 data URI for multimodal prompting."},"previous_interaction_id":{"type":"string","description":"Gemini Interactions API id from a previous Omni generation, used for conversational edits. `task` is not sent with it: describe the edit or extension in the prompt."},"task":{"type":"string","enum":["text_to_video","image_to_video","reference_to_video","edit","extend"],"description":"Gemini Omni video task. Defaults are inferred from the supplied media inputs."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["360p","720p","1080p","4k"],"description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10],"default":"10"},"delivery":{"type":"string","enum":["uri"],"default":"uri","description":"Gemini Omni video response delivery mode."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-omni-1.1-flash, google/gemini-omni-1.1-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["gemini-omni-1.2-flash","google/gemini-omni-1.2-flash"]},"prompt":{"type":"string","minLength":1,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"Image URL, gs:// URI, or base64 data URI. Used as the first frame for image_to_video unless the prompt tags it as a reference."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6,"description":"Reference image URLs, gs:// URIs, or base64 data URIs. Use prompt tags such as <IMAGE_REF_0> to bind image roles. Pass exactly two images with task=image_to_video for first/last frame interpolation."},"video_url":{"type":"string","format":"uri","description":"Video URL, gs:// URI, or base64 data URI for edit and extend workflows."},"previous_interaction_id":{"type":"string","description":"Gemini Interactions API id from a previous Omni generation, used for conversational edits. `task` is not sent with it: describe the edit or extension in the prompt."},"task":{"type":"string","enum":["text_to_video","image_to_video","reference_to_video","edit","extend"],"description":"Gemini Omni video task. Defaults are inferred from the supplied media inputs."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["360p","720p","1080p","4k"],"description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"delivery":{"type":"string","enum":["uri"],"default":"uri","description":"Gemini Omni video response delivery mode."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"gemini-omni-1.2-flash, google/gemini-omni-1.2-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo-3.1-t2v","google/veo-3.1-t2v-fast","veo3.1","veo3.1/fast"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"auto_fix":{"type":"boolean","default":true,"description":"Whether to automatically attempt to fix prompts that fail content policy or other validation checks by rewriting them."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enhance the video generation."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"google/veo-3.1-t2v, google/veo-3.1-t2v-fast, veo3.1, veo3.1/fast"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo-3.1-i2v","google/veo-3.1-i2v-fast","veo3.1/image-to-video","veo3.1/fast/image-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the input image to animate. Should be 720p or higher resolution."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"google/veo-3.1-i2v, google/veo-3.1-i2v-fast, veo3.1/image-to-video, veo3.1/fast/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo-3.1-first-last-image-to-video","google/veo-3.1-first-last-image-to-video-fast","veo3.1/first-last-frame-to-video","veo3.1/fast/first-last-frame-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the input image to animate. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. When this parameter is provided, the video duration can only be 8s."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url","last_image_url"],"title":"google/veo-3.1-first-last-image-to-video, google/veo-3.1-first-last-image-to-video-fast, veo3.1/first-last-frame-to-video, veo3.1/fast/first-last-frame-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo-3.1-reference-to-video","veo3.1/reference-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"URL of the input image to animate. Should be 720p or higher resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[8]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"google/veo-3.1-reference-to-video, veo3.1/reference-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo3-1-extend-video","google/veo3-1-fast-extend-video","veo3.1/extend-video","veo3.1/fast/extend-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"aspect_ratio":{"type":"string","enum":["auto","16:9","9:16"],"default":"auto","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[7],"default":"7"},"resolution":{"type":"string","enum":["720p"],"default":"720p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"auto_fix":{"type":"boolean","default":false,"description":"Whether to automatically attempt to fix prompts that fail content policy or other validation checks by rewriting them."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"google/veo3-1-extend-video, google/veo3-1-fast-extend-video, veo3.1/extend-video, veo3.1/fast/extend-video"},{"type":"object","properties":{"model":{"type":"string","enum":["google/veo-3-1-lite-generate-preview","veo3.1/lite/image-to-video","veo3.1/lite/first-last-frame-to-video","veo3.1/lite"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution. When this parameter is provided, the video duration can only be 8s."},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"google/veo-3-1-lite-generate-preview, veo3.1/lite/image-to-video, veo3.1/lite/first-last-frame-to-video, veo3.1/lite"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.1-t2v-plus","alibaba/wan2.1-t2v-plus"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["720P"],"default":"720P","description":"An enumeration where the short side of the video frame determines the resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.1-t2v-plus, alibaba/wan2.1-t2v-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.1-t2v-turbo","alibaba/wan2.1-t2v-turbo"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["480P","720P"],"default":"720P","description":"An enumeration where the short side of the video frame determines the resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.1-t2v-turbo, alibaba/wan2.1-t2v-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.2-i2v-plus","alibaba/wan2.2-i2v-plus"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"resolution":{"type":"string","enum":["480P","1080P"],"default":"1080P","description":"An enumeration where the short side of the video frame determines the resolution."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"wan2.2-i2v-plus, alibaba/wan2.2-i2v-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.2-t2v-plus","alibaba/wan2.2-t2v-plus"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["480P","1080P"],"default":"1080P","description":"An enumeration where the short side of the video frame determines the resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.2-t2v-plus, alibaba/wan2.2-t2v-plus"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.5-t2v-preview","alibaba/wan2.5-t2v-preview"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.5-t2v-preview, alibaba/wan2.5-t2v-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.5-i2v-preview","alibaba/wan2.5-i2v-preview"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"wan2.5-i2v-preview, alibaba/wan2.5-i2v-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.6-t2v","alibaba/wan2.6-t2v","wan2.7-t2v","alibaba/wan2.7-t2v","alibaba/wan-2-6-t2v","alibaba/wan-2-7-t2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file. The model will use this audio to generate the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10,15],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"shot_type":{"type":"string","enum":["single","multi"],"default":"single","description":"Specifies the shot type of the generated video, that is, whether the video consists of a single continuous shot or multiple switched shots.\nThis parameter takes effect only when \"prompt_extend\" is set to 'true':\n- single: (default) Outputs a single-shot video.\n- multi: Outputs a multi-shot video."},"generate_audio":{"type":"boolean","default":true,"description":"Specifies whether to automatically add audio to the generated video.\nThis parameter takes effect only when 'audio_url' is not provided."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.6-t2v, alibaba/wan2.6-t2v, wan2.7-t2v, alibaba/wan2.7-t2v, alibaba/wan-2-6-t2v, alibaba/wan-2-7-t2v"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.6-i2v","alibaba/wan2.6-i2v","alibaba/wan-2-6-i2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file. The model will use this audio to generate the video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10,15],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"shot_type":{"type":"string","enum":["single","multi"],"default":"single","description":"Specifies the shot type of the generated video, that is, whether the video consists of a single continuous shot or multiple switched shots.\nThis parameter takes effect only when \"prompt_extend\" is set to 'true':\n- single: (default) Outputs a single-shot video.\n- multi: Outputs a multi-shot video."},"generate_audio":{"type":"boolean","default":true,"description":"Specifies whether to automatically add audio to the generated video.\nThis parameter takes effect only when 'audio_url' is not provided."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"wan2.6-i2v, alibaba/wan2.6-i2v, alibaba/wan-2-6-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.6-i2v-flash","alibaba/wan2.6-i2v-flash","alibaba/wan-2-6-image-to-video-flash"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file. The model will use this audio to generate the video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"Duration of the generated video in seconds (up to 15 seconds for Flash model).","enum":[5,10,15],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"shot_type":{"type":"string","enum":["single","multi"],"default":"single","description":"Specifies the shot type of the generated video, that is, whether the video consists of a single continuous shot or multiple switched shots.\nThis parameter takes effect only when \"prompt_extend\" is set to 'true':\n- single: (default) Outputs a single-shot video.\n- multi: Outputs a multi-shot video."},"generate_audio":{"type":"boolean","default":true,"description":"Specifies whether to automatically add audio to the generated video.\nThis parameter takes effect only when 'audio_url' is not provided."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"wan2.6-i2v-flash, alibaba/wan2.6-i2v-flash, alibaba/wan-2-6-image-to-video-flash"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.6-r2v","alibaba/wan2.6-r2v","alibaba/wan-2-6-r2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"An array of URLs for the uploaded reference video files. This parameter is used to extract the character's appearance and voice (if any) to generate a video that matches the reference features.\nEach reference video must contain only one character. For example, character1 is a little girl and character2 is an alarm clock."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10,15],"default":"10"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"shot_type":{"type":"string","enum":["single","multi"],"default":"single","description":"Specifies the shot type of the generated video, that is, whether the video consists of a single continuous shot or multiple switched shots.\nThis parameter takes effect only when \"prompt_extend\" is set to 'true':\n- single: (default) Outputs a single-shot video.\n- multi: Outputs a multi-shot video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_urls"],"title":"wan2.6-r2v, alibaba/wan2.6-r2v, alibaba/wan-2-6-r2v"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.7-i2v","alibaba/wan2.7-i2v","alibaba/wan-2-7-i2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file. The model will use this audio to generate the video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10,15],"default":"10"},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"wan2.7-i2v, alibaba/wan2.7-i2v, alibaba/wan-2-7-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["wan2.7-r2v","alibaba/wan2.7-r2v","alibaba/wan-2-7-r2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"first_frame_image":{"type":"string","format":"uri","description":"Optional first frame image URL."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"Reference image URLs."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"Reference video URLs."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10,15],"default":"10"},"enhance_prompt":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"negative_prompt":{"type":"string","maxLength":500,"description":"The description of elements to avoid in the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan2.7-r2v, alibaba/wan2.7-r2v, alibaba/wan-2-7-r2v"},{"type":"object","properties":{"model":{"type":"string","enum":["wan3.0-video","alibaba/wan3.0-video","alibaba/wan-3-0-video"]},"prompt":{"type":"string","maxLength":20000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"The URL of the image strictly used as the first frame of the video. Cannot be used together with reference media, file_url, or link_url."},"last_image_url":{"type":"string","format":"uri","description":"The URL of the image strictly used as the last frame of the video. Requires image_url."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Array of image URLs for multi-image-to-video generation."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"Reference video URLs. Up to 5 clips with a total duration of no more than 15 seconds."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"description":"Reference audio URLs. Up to 5 clips with a total duration of no more than 15 seconds."},"file_url":{"type":"string","format":"uri","description":"The URL of a document (docx, doc, xlsx, xls, pptx, ppt, pdf, txt, key, pages, numbers, md) the model uses to generate the video. Cannot be used together with link_url."},"link_url":{"type":"string","format":"uri","description":"The URL of a publicly accessible web page the model uses to generate the video. Cannot be used together with file_url."},"aspect_ratio":{"type":"string","enum":["adaptive","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds, from 2 to 30. When reference videos are provided, the total input video duration plus the output video duration must not exceed 30 seconds.","default":5},"generate_audio":{"type":"boolean","default":true,"description":"Specifies whether the output video contains audio."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"wan3.0-video, alibaba/wan3.0-video, alibaba/wan-3-0-video"},{"type":"object","properties":{"model":{"type":"string","enum":["custom:happyhorse-1.0","alibaba/custom:happyhorse-1.0","happyhorse-1.0-t2v","alibaba/happyhorse-1.0-t2v","happyhorse-1.0-i2v","alibaba/happyhorse-1.0-i2v","happyhorse-1.0-r2v","alibaba/happyhorse-1.0-r2v","happyhorse-1.0-video-edit","alibaba/happyhorse-1.0-video-edit","alibaba/happyhorse-1-0"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Array of image URLs for multi-image-to-video generation."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds. \nThe option does not work if a video reference is provided. \n- If the input video is 15 seconds or shorter, the output video has the same duration as the input.\n- If the input video is longer than 15 seconds, the system automatically uses only the first 15 seconds, so the maximum output duration is 15 seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"audio_setting":{"type":"string","enum":["auto","origin"],"default":"auto","description":"Audio control. Works only if a video reference is provided.\n- auto (default): Determined by the model.\n- origin: Preserves the original audio from the input video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"custom:happyhorse-1.0, alibaba/custom:happyhorse-1.0, happyhorse-1.0-t2v, alibaba/happyhorse-1.0-t2v, happyhorse-1.0-i2v, alibaba/happyhorse-1.0-i2v, happyhorse-1.0-r2v, alibaba/happyhorse-1.0-r2v, happyhorse-1.0-video-edit, alibaba/happyhorse-1.0-video-edit, alibaba/happyhorse-1-0"},{"type":"object","properties":{"model":{"type":"string","enum":["happyhorse-1.1-t2v","alibaba/happyhorse-1.1-t2v","alibaba/happyhorse-1-1","alibaba/happyhorse-1-1-t2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"happyhorse-1.1-t2v, alibaba/happyhorse-1.1-t2v, alibaba/happyhorse-1-1, alibaba/happyhorse-1-1-t2v"},{"type":"object","properties":{"model":{"type":"string","enum":["happyhorse-1.1-i2v","alibaba/happyhorse-1.1-i2v","alibaba/happyhorse-1-1","alibaba/happyhorse-1-1-i2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"happyhorse-1.1-i2v, alibaba/happyhorse-1.1-i2v, alibaba/happyhorse-1-1, alibaba/happyhorse-1-1-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["happyhorse-1.1-r2v","alibaba/happyhorse-1.1-r2v","alibaba/happyhorse-1-1","alibaba/happyhorse-1-1-r2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Array of image URLs for multi-image-to-video generation."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","reference_image_urls"],"title":"happyhorse-1.1-r2v, alibaba/happyhorse-1.1-r2v, alibaba/happyhorse-1-1, alibaba/happyhorse-1-1-r2v"},{"type":"object","properties":{"model":{"type":"string","enum":["custom:happyhorse-1.1","alibaba/custom:happyhorse-1.1","alibaba/happyhorse-1-1"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Array of image URLs for multi-image-to-video generation."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"10"},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"custom:happyhorse-1.1, alibaba/custom:happyhorse-1.1, alibaba/happyhorse-1-1"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/wan2.2-vace-fun-a14b-depth","alibaba/wan2.2-vace-fun-a14b-pose","wan-22-vace-fun-a14b/depth","wan-22-vace-fun-a14b/pose"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"negative_prompt":{"type":"string","default":"letterboxing, borders, black bars, bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards","description":"The description of elements to avoid in the generated video."},"match_input_num_frames":{"type":"boolean"},"num_frames":{"type":"integer","minimum":17,"maximum":241,"default":81,"description":"Number of frames to generate."},"match_input_frames_per_second":{"type":"boolean","description":"Whether to match the input video's frames per second (FPS)."},"frames_per_second":{"type":"integer","minimum":5,"maximum":30,"default":16,"description":"Frames per second of the generated video."},"resolution":{"type":"string","enum":["480p","580p","720p"],"default":"480p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["auto","16:9","1:1","9:16"],"default":"auto","description":"The aspect ratio of the generated video."},"num_inference_steps":{"type":"integer","default":30,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"guidance_scale":{"type":"number","default":5,"description":"Classifier-free guidance scale. Controls prompt adherence / creativity."},"shift":{"type":"number","default":5,"description":"Noise schedule shift parameter. Affects temporal dynamics."},"enable_safety_checker":{"type":"boolean","description":"If set to true, the safety checker will be enabled."},"enable_prompt_expansion":{"type":"boolean","description":"Whether to enable prompt expansion."},"preprocess":{"type":"boolean","description":"Whether to preprocess the input video."},"acceleration":{"type":"string","enum":["none","regular"],"default":"regular","description":"Acceleration to use for inference."},"video_quality":{"type":"string","enum":["low","medium","high","maximum"],"default":"high","description":"The quality of the generated video."},"video_write_mode":{"type":"string","enum":["fast","balanced","small"],"default":"balanced","description":"The method used to write the video."},"num_interpolated_frames":{"type":"integer","description":"Number of frames to interpolate between the original frames."},"temporal_downsample_factor":{"type":"integer","description":"Temporal downsample factor for the video."},"enable_auto_downsample":{"type":"boolean","description":"The minimum frames per second to downsample the video to."},"auto_downsample_min_fps":{"type":"number","default":15,"description":"The minimum frames per second to downsample the video to."},"interpolator_model":{"type":"string","enum":["rife","film"],"default":"film","description":"The model to use for interpolation. Rife, or film are available."},"sync_mode":{"type":"boolean","description":"The synchronization mode for audio and video. Loose or tight are available."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"alibaba/wan2.2-vace-fun-a14b-depth, alibaba/wan2.2-vace-fun-a14b-pose, wan-22-vace-fun-a14b/depth, wan-22-vace-fun-a14b/pose"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/wan2.2-vace-fun-a14b-inpainting","wan-22-vace-fun-a14b/inpainting"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"negative_prompt":{"type":"string","default":"letterboxing, borders, black bars, bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards","description":"The description of elements to avoid in the generated video."},"match_input_num_frames":{"type":"boolean"},"num_frames":{"type":"integer","minimum":17,"maximum":241,"default":81,"description":"Number of frames to generate."},"match_input_frames_per_second":{"type":"boolean","description":"Whether to match the input video's frames per second (FPS)."},"frames_per_second":{"type":"integer","minimum":5,"maximum":30,"default":16,"description":"Frames per second of the generated video."},"resolution":{"type":"string","enum":["480p","580p","720p"],"default":"480p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["auto","16:9","1:1","9:16"],"default":"auto","description":"The aspect ratio of the generated video."},"num_inference_steps":{"type":"integer","default":30,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"guidance_scale":{"type":"number","default":5,"description":"Classifier-free guidance scale. Controls prompt adherence / creativity."},"shift":{"type":"number","default":5,"description":"Noise schedule shift parameter. Affects temporal dynamics."},"enable_safety_checker":{"type":"boolean","description":"If set to true, the safety checker will be enabled."},"enable_prompt_expansion":{"type":"boolean","description":"Whether to enable prompt expansion."},"preprocess":{"type":"boolean","description":"Whether to preprocess the input video."},"acceleration":{"type":"string","enum":["none","regular"],"default":"regular","description":"Acceleration to use for inference."},"video_quality":{"type":"string","enum":["low","medium","high","maximum"],"default":"high","description":"The quality of the generated video."},"video_write_mode":{"type":"string","enum":["fast","balanced","small"],"default":"balanced","description":"The method used to write the video."},"num_interpolated_frames":{"type":"integer","description":"Number of frames to interpolate between the original frames."},"temporal_downsample_factor":{"type":"integer","description":"Temporal downsample factor for the video."},"enable_auto_downsample":{"type":"boolean","description":"The minimum frames per second to downsample the video to."},"auto_downsample_min_fps":{"type":"number","default":15,"description":"The minimum frames per second to downsample the video to."},"interpolator_model":{"type":"string","enum":["rife","film"],"default":"film","description":"The model to use for interpolation. Rife, or film are available."},"sync_mode":{"type":"boolean","description":"The synchronization mode for audio and video. Loose or tight are available."},"image_list":{"type":"array","items":{"type":"string","format":"uri"},"description":"Array of image URLs for multi-image-to-video generation."},"mask_video_url":{"type":"string","format":"uri","description":"URL to the source mask file"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"alibaba/wan2.2-vace-fun-a14b-inpainting, wan-22-vace-fun-a14b/inpainting"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/wan2.2-vace-fun-a14b-outpainting","wan-22-vace-fun-a14b/outpainting"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"negative_prompt":{"type":"string","default":"letterboxing, borders, black bars, bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards","description":"The description of elements to avoid in the generated video."},"match_input_num_frames":{"type":"boolean"},"num_frames":{"type":"integer","minimum":17,"maximum":241,"default":81,"description":"Number of frames to generate."},"match_input_frames_per_second":{"type":"boolean","description":"Whether to match the input video's frames per second (FPS)."},"frames_per_second":{"type":"integer","minimum":5,"maximum":30,"default":16,"description":"Frames per second of the generated video."},"resolution":{"type":"string","enum":["480p","580p","720p"],"default":"480p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["auto","16:9","1:1","9:16"],"default":"auto","description":"The aspect ratio of the generated video."},"num_inference_steps":{"type":"integer","default":30,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"guidance_scale":{"type":"number","default":5,"description":"Classifier-free guidance scale. Controls prompt adherence / creativity."},"shift":{"type":"number","default":5,"description":"Noise schedule shift parameter. Affects temporal dynamics."},"enable_safety_checker":{"type":"boolean","description":"If set to true, the safety checker will be enabled."},"enable_prompt_expansion":{"type":"boolean","description":"Whether to enable prompt expansion."},"preprocess":{"type":"boolean","description":"Whether to preprocess the input video."},"acceleration":{"type":"string","enum":["none","regular"],"default":"regular","description":"Acceleration to use for inference."},"video_quality":{"type":"string","enum":["low","medium","high","maximum"],"default":"high","description":"The quality of the generated video."},"video_write_mode":{"type":"string","enum":["fast","balanced","small"],"default":"balanced","description":"The method used to write the video."},"num_interpolated_frames":{"type":"integer","description":"Number of frames to interpolate between the original frames."},"temporal_downsample_factor":{"type":"integer","description":"Temporal downsample factor for the video."},"enable_auto_downsample":{"type":"boolean","description":"The minimum frames per second to downsample the video to."},"auto_downsample_min_fps":{"type":"number","default":15,"description":"The minimum frames per second to downsample the video to."},"interpolator_model":{"type":"string","enum":["rife","film"],"default":"film","description":"The model to use for interpolation. Rife, or film are available."},"sync_mode":{"type":"boolean","description":"The synchronization mode for audio and video. Loose or tight are available."},"expand_left":{"type":"boolean","default":true,"description":"Whether to expand the video to the left"},"expand_right":{"type":"boolean","default":true,"description":"Whether to expand the video to the right"},"expand_top":{"type":"boolean","default":true,"description":"Whether to expand the video to the top"},"expand_bottom":{"type":"boolean","default":true,"description":"Whether to expand the video to the bottom"},"expand_ratio":{"type":"number","default":0.25,"description":"Amount of expansion. This is a float value between 0 and 1, where 0.25 adds 25% to the original video size on the specified sides"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"alibaba/wan2.2-vace-fun-a14b-outpainting, wan-22-vace-fun-a14b/outpainting"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/wan2.2-vace-fun-a14b-reframe","wan-22-vace-fun-a14b/reframe"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"negative_prompt":{"type":"string","default":"letterboxing, borders, black bars, bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards","description":"The description of elements to avoid in the generated video."},"match_input_num_frames":{"type":"boolean"},"num_frames":{"type":"integer","minimum":17,"maximum":241,"default":81,"description":"Number of frames to generate."},"match_input_frames_per_second":{"type":"boolean","description":"Whether to match the input video's frames per second (FPS)."},"frames_per_second":{"type":"integer","minimum":5,"maximum":30,"default":16,"description":"Frames per second of the generated video."},"resolution":{"type":"string","enum":["480p","580p","720p"],"default":"480p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["auto","16:9","1:1","9:16"],"default":"auto","description":"The aspect ratio of the generated video."},"num_inference_steps":{"type":"integer","default":30,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"guidance_scale":{"type":"number","default":5,"description":"Classifier-free guidance scale. Controls prompt adherence / creativity."},"shift":{"type":"number","default":5,"description":"Noise schedule shift parameter. Affects temporal dynamics."},"enable_safety_checker":{"type":"boolean","description":"If set to true, the safety checker will be enabled."},"enable_prompt_expansion":{"type":"boolean","description":"Whether to enable prompt expansion."},"preprocess":{"type":"boolean","description":"Whether to preprocess the input video."},"acceleration":{"type":"string","enum":["none","regular"],"default":"regular","description":"Acceleration to use for inference."},"video_quality":{"type":"string","enum":["low","medium","high","maximum"],"default":"high","description":"The quality of the generated video."},"video_write_mode":{"type":"string","enum":["fast","balanced","small"],"default":"balanced","description":"The method used to write the video."},"num_interpolated_frames":{"type":"integer","description":"Number of frames to interpolate between the original frames."},"temporal_downsample_factor":{"type":"integer","description":"Temporal downsample factor for the video."},"enable_auto_downsample":{"type":"boolean","description":"The minimum frames per second to downsample the video to."},"auto_downsample_min_fps":{"type":"number","default":15,"description":"The minimum frames per second to downsample the video to."},"interpolator_model":{"type":"string","enum":["rife","film"],"default":"film","description":"The model to use for interpolation. Rife, or film are available."},"sync_mode":{"type":"boolean","description":"The synchronization mode for audio and video. Loose or tight are available."},"zoom_factor":{"type":"number","description":"Zoom factor for the video. When this value is greater than 0, the video will be zoomed in by this factor (in relation to the canvas size,) cutting off the edges of the video. A value of 0 means no zoom"},"trim_borders":{"type":"boolean","default":true,"description":"Whether to trim borders from the video"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url"],"title":"alibaba/wan2.2-vace-fun-a14b-reframe, wan-22-vace-fun-a14b/reframe"},{"type":"object","properties":{"model":{"type":"string","enum":["alibaba/wan2.2-14b-animate-move","alibaba/wan2.2-14b-animate-replace","wan/v2.2-14b/animate/move","wan/v2.2-14b/animate/replace"]},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image. If the input image does not match the chosen aspect ratio, it is resized and center cropped"},"resolution":{"type":"string","enum":["480p","580p","720p"],"default":"480p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"num_inference_steps":{"type":"integer","default":20,"description":"Number of inference steps for sampling. Higher values give better quality but take longer"},"enable_safety_checker":{"type":"boolean","description":"If set to true, the safety checker will be enabled."},"shift":{"type":"number","default":5,"description":"Shift value for the video."},"video_quality":{"type":"string","enum":["low","medium","high","maximum"],"default":"high","description":"The quality of the generated video."},"video_write_mode":{"type":"string","enum":["fast","balanced","small"],"default":"balanced","description":"The write mode of the output video. Faster write mode means faster results but larger file size, balanced write mode is a good compromise between speed and quality, and small write mode is the slowest but produces the smallest file size"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url","image_url"],"title":"alibaba/wan2.2-14b-animate-move, alibaba/wan2.2-14b-animate-replace, wan/v2.2-14b/animate/move, wan/v2.2-14b/animate/replace"},{"type":"object","properties":{"model":{"type":"string","enum":["video-01"]},"prompt":{"type":"string","maxLength":2000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"enhance_prompt":{"type":"boolean","default":true,"description":"If True, the incoming prompt will be automatically optimized to improve generation quality when needed. For more precise control, set it to False — the model will then follow the instructions more strictly."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"video-01"},{"type":"object","properties":{"model":{"type":"string","enum":["video-01-live2d"]},"prompt":{"type":"string","maxLength":2000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB.","required":true},"enhance_prompt":{"type":"boolean","default":true,"description":"If True, the incoming prompt will be automatically optimized to improve generation quality when needed. For more precise control, set it to False — the model will then follow the instructions more strictly."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"video-01-live2d"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/hailuo-02"]},"prompt":{"type":"string","maxLength":2000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"resolution":{"type":"string","enum":["768P","1080P"],"default":"768P","description":"The dimensions of the video display. 1080p corresponds to 1920 x 1080 pixels, 768p corresponds to 1366 x 768 pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. For 1080p resolution, only a duration of 6 seconds is supported","enum":[6,10]},"enhance_prompt":{"type":"boolean","default":true,"description":"If True, the incoming prompt will be automatically optimized to improve generation quality when needed. For more precise control, set it to False — the model will then follow the instructions more strictly."},"fast_pretreatment":{"type":"boolean","default":false,"description":"Reduces optimization time when enhance_prompt is enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/hailuo-02"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/hailuo-2.3"]},"prompt":{"type":"string","maxLength":2000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"resolution":{"type":"string","enum":["768P","1080P"],"default":"768P","description":"The dimensions of the video display. 1080p corresponds to 1920 x 1080 pixels, 768p corresponds to 1366 x 768 pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. For 1080p resolution, only a duration of 6 seconds is supported","enum":[6,10]},"enhance_prompt":{"type":"boolean","default":true,"description":"If True, the incoming prompt will be automatically optimized to improve generation quality when needed. For more precise control, set it to False — the model will then follow the instructions more strictly."},"fast_pretreatment":{"type":"boolean","default":false,"description":"Reduces optimization time when enhance_prompt is enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/hailuo-2.3"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/hailuo-2.3-fast"]},"prompt":{"type":"string","maxLength":2000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"resolution":{"type":"string","enum":["768P","1080P"],"default":"768P","description":"The dimensions of the video display. 1080p corresponds to 1920 x 1080 pixels, 768p corresponds to 1366 x 768 pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. For 1080p resolution, only a duration of 6 seconds is supported","enum":[6,10]},"enhance_prompt":{"type":"boolean","default":true,"description":"If True, the incoming prompt will be automatically optimized to improve generation quality when needed. For more precise control, set it to False — the model will then follow the instructions more strictly."},"fast_pretreatment":{"type":"boolean","default":false,"description":"Reduces optimization time when enhance_prompt is enabled."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"minimax/hailuo-2.3-fast"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3"]},"prompt":{"type":"string","maxLength":7000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Passing an image reference allows the model to emulate the style or content of the reference in the output."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Passing a video reference allows the model to emulate the style or content of the reference in the output."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Reference audio clips whose voice timbre the generated speech follows. Cannot be the only reference — pass at least one reference image or video alongside."},"duration":{"type":"integer","minimum":4,"maximum":15,"default":6,"description":"The length of the output video in seconds."},"resolution":{"type":"string","enum":["2K"],"default":"2K","description":"The resolution of the output video, where the number refers to the short side in pixels."},"ratio":{"type":"string","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive","description":"The aspect ratio of the generated video. Defaults to `adaptive`, which follows the first/last frame or reference input; text-only generation cannot be `adaptive` and defaults to `16:9` instead."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/h3"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3-highspeed","MiniMax-H3-Highspeed"]},"prompt":{"type":"string","maxLength":7000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Passing an image reference allows the model to emulate the style or content of the reference in the output."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Passing a video reference allows the model to emulate the style or content of the reference in the output."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Reference audio clips whose voice timbre the generated speech follows. Cannot be the only reference — pass at least one reference image or video alongside."},"duration":{"type":"integer","minimum":4,"maximum":15,"default":6,"description":"The length of the output video in seconds."},"resolution":{"type":"string","enum":["480P","768P"],"default":"768P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"ratio":{"type":"string","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive","description":"The aspect ratio of the generated video. Defaults to `adaptive`, which follows the first/last frame or reference input; text-only generation cannot be `adaptive` and defaults to `16:9` instead."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/h3-highspeed, MiniMax-H3-Highspeed"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3-lite","MiniMax-H3-Lite"]},"prompt":{"type":"string","maxLength":7000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Passing an image reference allows the model to emulate the style or content of the reference in the output."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Passing a video reference allows the model to emulate the style or content of the reference in the output."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Reference audio clips whose voice timbre the generated speech follows. Cannot be the only reference — pass at least one reference image or video alongside."},"duration":{"type":"integer","minimum":4,"maximum":15,"default":6,"description":"The length of the output video in seconds."},"resolution":{"type":"string","enum":["480P","768P"],"default":"768P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"ratio":{"type":"string","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"Reference generation defaults to 16:9 and requires a concrete ratio. Image-to-video follows the frame aspect ratio."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/h3-lite, MiniMax-H3-Lite"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3-max","minimax/h3-max/image-to-video","minimax/h3-max/reference-to-video","minimax/h3-max/text-to-video"]},"prompt":{"type":"string","maxLength":50000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the first frame for the video.\nImage specifications: \n- format must be JPG, JPEG, or PNG; \n- aspect ratio should be greater than 2:5 and less than 5:2; \n- the shorter side must exceed 300 pixels; \n- file size must not exceed 20MB."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9,"description":"Subject or style reference images, referred to in the prompt as Image 1, Image 2, and so on. Reference images, videos and audio clips must add up to at most 12 files."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Motion reference video clips of 2-15 seconds each and at most 15 seconds combined, referred to in the prompt as Video 1, Video 2, and so on. Reference images, videos and audio clips must add up to at most 12 files."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3,"description":"Reference audio clips of 2-15 seconds each and at most 15 seconds combined, referred to in the prompt as Audio 1, Audio 2, and so on. Cannot be the only reference — pass at least one reference image or video alongside. Reference images, videos and audio clips must add up to at most 12 files."},"ratio":{"type":"string","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive","description":"The aspect ratio of the generated video. This parameter is ignored if image_url is provided. Defaults to `adaptive`, which lets the model choose the ratio and requires a reference input; text-only generation cannot be `adaptive` and defaults to `16:9` instead."},"resolution":{"type":"string","enum":["480p","768p"],"default":"768p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","minimum":5,"maximum":15,"default":5,"description":"The length of the output video in seconds. 5 to 10 seconds is the recommended range."},"prompt_expansion_mode":{"type":"string","enum":["balanced","quality"],"default":"balanced","description":"How much effort the model spends rewriting the prompt before generation. `balanced` returns in about a second; `quality` spends up to 30 seconds on a richer prompt."},"enable_safety_checker":{"type":"boolean","default":true,"description":"If set to true, the safety checker will be enabled."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/h3-max, minimax/h3-max/image-to-video, minimax/h3-max/reference-to-video, minimax/h3-max/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/h3-max-recast","minimax/h3-max/recast"]},"video_url":{"type":"string","format":"uri","description":"The source video, 5 to 30 seconds long, with no single shot longer than 15 seconds. The result keeps its length, motion, camera, cuts and sound."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"One photo per new person, 1 to 4 photos. By default they replace the main people in the video from left to right, in every shot they appear in."},"prompt":{"type":"string","maxLength":2000,"description":"Who becomes whom, or what else to keep or change."},"resolution":{"type":"string","enum":["768p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"seed":{"type":"integer","minimum":0,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"enhance_realism":{"type":"boolean","default":false,"description":"More natural skin textures and better blending of the new people into the scene."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url","reference_image_urls"],"title":"minimax/h3-max-recast, minimax/h3-max/recast"},{"type":"object","properties":{"model":{"type":"string","enum":["xai/grok-imagine-video","x-ai/grok-imagine-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the source image to animate (image-to-video mode). Omit for text-to-video. Cannot be combined with `reference_images`."},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of reference image URLs (reference-to-video mode). Up to 7 images. Cannot be combined with `image_url`."},"duration":{"type":"integer","description":"The length of the output video in seconds.","minimum":1,"maximum":15,"default":10},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p"],"default":"480p","description":"Output video resolution.\nDefaults to 480p. Higher resolution increases the price per second."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"xai/grok-imagine-video, x-ai/grok-imagine-video"},{"type":"object","properties":{"model":{"type":"string","enum":["xai/grok-imagine-video-1.5-preview","x-ai/grok-imagine-video-1.5-preview"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the source image to animate. Required — this model supports image-to-video only."},"duration":{"type":"integer","description":"The length of the output video in seconds.","minimum":1,"maximum":15,"default":10},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"480p","description":"Output video resolution.\nDefaults to 480p. Higher resolution increases the price per second."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"xai/grok-imagine-video-1.5-preview, x-ai/grok-imagine-video-1.5-preview"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1/standard/image-to-video","kling-video/v1/pro/image-to-video","kling-video/v1.5/pro/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"static_mask":{"type":"string","format":"uri","description":"URL of the image for Static Brush Application Area (Mask image created by users using the motion brush)."},"dynamic_masks":{"type":"array","items":{"type":"object","properties":{"mask":{"type":"string","format":"uri"},"trajectories":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"integer"}},"required":["x","y"]},"minItems":2,"maxItems":77}},"required":["mask","trajectories"]},"maxItems":6,"description":"List of dynamic masks."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1/standard/image-to-video, kling-video/v1/pro/image-to-video, kling-video/v1.5/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1/standard/text-to-video","kling-video/v1/pro/text-to-video","kling-video/v1.5/pro/text-to-video","kling-video/v1.6/pro/text-to-video","klingai/v2-master-text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10]},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"camera_control":{"type":"string","enum":["down_back","forward_up","right_turn_forward","left_turn_forward"],"description":"Camera control parameters."},"advanced_camera_control":{"type":"object","properties":{"movement_type":{"type":"string","enum":["horizontal","vertical","pan","tilt","roll","zoom"],"default":"horizontal","description":"The type of camera movement."},"movement_value":{"type":"integer","minimum":-10,"maximum":10,"default":0,"description":"The value of the camera movement."}},"description":"Advanced camera control parameters."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"kling-video/v1/standard/text-to-video, kling-video/v1/pro/text-to-video, kling-video/v1.5/pro/text-to-video, kling-video/v1.6/pro/text-to-video, klingai/v2-master-text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/text-to-video","kling-video/v1.6/pro/text-to-video","klingai/v2.1-master-text-to-video","klingai/v2.5-turbo/pro/text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10]},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"kling-video/v1.6/standard/text-to-video, kling-video/v1.6/pro/text-to-video, klingai/v2.1-master-text-to-video, klingai/v2.5-turbo/pro/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/text-to-video","klingai/v2-master-text-to-video","klingai/v2.1-master-text-to-video","klingai/v2.5-turbo/pro/text-to-video","kling-video/v2.5-turbo/pro/text-to-video","kling-video/v1.5/pro/text-to-video","kling-video/v2/master/text-to-video","kling-video/v2.1/master/text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"description":"The aspect ratio of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"kling-video/v1.6/standard/text-to-video, klingai/v2-master-text-to-video, klingai/v2.1-master-text-to-video, klingai/v2.5-turbo/pro/text-to-video, kling-video/v2.5-turbo/pro/text-to-video, kling-video/v1.5/pro/text-to-video, kling-video/v2/master/text-to-video, kling-video/v2.1/master/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/image-to-video","kling-video/v2.1/standard/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1.6/standard/image-to-video, kling-video/v2.1/standard/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/image-to-video","klingai/v2-master-image-to-video","kling-video/v2.1/standard/image-to-video","klingai/v2.1-master-image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1.6/standard/image-to-video, klingai/v2-master-image-to-video, kling-video/v2.1/standard/image-to-video, klingai/v2.1-master-image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/image-to-video","klingai/v2-master-image-to-video","klingai/v2.1-master-image-to-video","klingai/v2.5-turbo/pro/image-to-video","kling-video/v2.5-turbo/pro/image-to-video","kling-video/v2/master/image-to-video","kling-video/v2.1/standard/image-to-video","kling-video/v2.1/master/image-to-video"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","prompt"],"title":"kling-video/v1.6/standard/image-to-video, klingai/v2-master-image-to-video, klingai/v2.1-master-image-to-video, klingai/v2.5-turbo/pro/image-to-video, kling-video/v2.5-turbo/pro/image-to-video, kling-video/v2/master/image-to-video, kling-video/v2.1/standard/image-to-video, kling-video/v2.1/master/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/pro/image-to-video","kling-video/v2.1/pro/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1.6/pro/image-to-video, kling-video/v2.1/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/pro/image-to-video","kling-video/v2.1/pro/image-to-video","klingai/v2.5-turbo/pro/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1.6/pro/image-to-video, kling-video/v2.1/pro/image-to-video, klingai/v2.5-turbo/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/kling-video-v1.6-pro-effects","klingai/kling-video-v1.6-standard-effects"]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"array","items":{"type":"string","format":"uri"}}],"description":"For hug, kiss, and heart_gesture effects, pass an array containing exactly two image URLs. For squish or expansion, only one image URL is required."},"effect_scene":{"type":"string","enum":["magic_fireball","pet_moto_rider","media_interview","pet_lion","pet_delivery","pet_chef","santa_gifts","santa_hug","girlfriend","boyfriend","heart_gesture_1","pet_wizard","smoke_smoke","thumbs_up","instant_kid","dollar_rain","cry_cry","building_collapse","gun_shot","mushroom","double_gun","pet_warrior","lightning_power","jesus_hug","shark_alert","long_hair","lie_flat","polar_bear_hug","brown_bear_hug","jazz_jazz","office_escape_plow","fly_fly","watermelon_bomb","pet_dance","boss_coming","wool_curly","iron_warrior","pet_bee","marry_me","swing_swing","day_to_night","piggy_morph","wig_out","car_explosion","ski_ski","tiger_hug","siblings","construction_worker","let's_ride","snatched","magic_broom","felt_felt","jumpdrop","celebration","splashsplash","hula","surfsurf","fairy_wing","angel_wing","dark_wing","skateskate","plushcut","jelly_press","jelly_slice","jelly_squish","jelly_jiggle","pixelpixel","yearbook","instant_film","anime_figure","rocketrocket","bloombloom","dizzydizzy","fuzzyfuzzy","squish","expansion","hug","kiss","heart_gesture","fight"],"description":"Video effect scene type"},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","effect_scene"],"title":"klingai/kling-video-v1.6-pro-effects, klingai/kling-video-v1.6-standard-effects"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1.6/standard/multi-image-to-video"]},"image_list":{"type":"array","items":{"type":"string","format":"uri"},"minItems":2,"maxItems":4,"description":"Array of image URLs for multi-image-to-video generation"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_list"],"title":"kling-video/v1.6/standard/multi-image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/avatar-standard","klingai/avatar-pro","kling-video/v1/standard/ai-avatar","kling-video/v1/pro/ai-avatar"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file. Supported formats: MP3, WAV, M4A, AAC. Maximum file size: 5 MB."},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","audio_url"],"title":"klingai/avatar-standard, klingai/avatar-pro, kling-video/v1/standard/ai-avatar, kling-video/v1/pro/ai-avatar"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-o1-image-to-video","kling-video/o1/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"klingai/video-o1-image-to-video, kling-video/o1/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-o1-reference-to-video","kling-video/o1/reference-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"image_list":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of image URLs for multi-image-to-video generation."},"elements":{"type":"array","items":{"type":"object","properties":{"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"Additional reference images from different angles."},"frontal_image_url":{"type":"string","format":"uri","description":"The frontal image of the element (main view)."}},"required":["reference_image_urls","frontal_image_url"]},"maxItems":4,"description":"Elements (characters/objects) to include in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"klingai/video-o1-reference-to-video, kling-video/o1/reference-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-o1-video-to-video-edit","kling-video/o1/video-to-video/edit"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"image_list":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of image URLs for multi-image-to-video generation."},"elements":{"type":"array","items":{"type":"object","properties":{"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"Additional reference images from different angles."},"frontal_image_url":{"type":"string","format":"uri","description":"The frontal image of the element (main view)."}},"required":["reference_image_urls","frontal_image_url"]},"maxItems":4,"description":"Elements (characters/objects) to include in the video."},"keep_audio":{"type":"boolean","default":false,"description":"Whether to keep the original audio from the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"klingai/video-o1-video-to-video-edit, kling-video/o1/video-to-video/edit"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-o1-video-to-video-reference","kling-video/o1/video-to-video/reference"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"image_list":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"Array of image URLs for multi-image-to-video generation."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"elements":{"type":"array","items":{"type":"object","properties":{"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"Additional reference images from different angles."},"frontal_image_url":{"type":"string","format":"uri","description":"The frontal image of the element (main view)."}},"required":["reference_image_urls","frontal_image_url"]},"maxItems":4,"description":"Elements (characters/objects) to include in the video."},"keep_audio":{"type":"boolean","default":false,"description":"Whether to keep the original audio from the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"klingai/video-o1-video-to-video-reference, kling-video/o1/video-to-video/reference"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v2-6-pro-image-to-video","kling-video/v2.6/pro/image-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"klingai/video-v2-6-pro-image-to-video, kling-video/v2.6/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v2-6-pro-text-to-video","kling-video/v2.6/pro/text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","maxLength":2500,"description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"klingai/video-v2-6-pro-text-to-video, kling-video/v2.6/pro/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v2-6-pro-motion-control"]},"prompt":{"type":"string","description":"Optional instructions that define the background elements, including their appearance, timing in the frame, and behavior, and can also subtly adjust the character’s animation."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that serves as the character reference for animation. The image must contain exactly one clearly visible character, who will be animated using the motion from the reference video provided in the video_url parameter. For optimal results, be sure the character’s proportions in the image match those in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. The character’s movements from this video will be applied to the character from the image provided in the image_url parameter. For best results, use a video with a single clearly visible character. If the video contains two or more characters, the motion of the character occupying the largest portion of the frame will be used for generation."},"character_orientation":{"type":"string","enum":["image","video"],"default":"video","description":"Generate the orientation of the character in the video, which can be selected to match the image or the video:\n- image: has the same orientation as the person in the picture; At this time, the reference video duration should not exceed 10 seconds;\n- video: consistent with the orientation of the characters in the video; At this time, the reference video duration should not exceed 30 seconds;"},"keep_audio":{"type":"boolean","default":true,"description":"Whether to keep the original audio from the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","video_url"],"title":"klingai/video-v2-6-pro-motion-control"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v2-6-motion-control","klingai/video-v3-motion-control"]},"prompt":{"type":"string","description":"Optional instructions that define the background elements, including their appearance, timing in the frame, and behavior, and can also subtly adjust the character’s animation."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that serves as the character reference for animation. The image must contain exactly one clearly visible character, who will be animated using the motion from the reference video provided in the video_url parameter. For optimal results, be sure the character’s proportions in the image match those in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. The character’s movements from this video will be applied to the character from the image provided in the image_url parameter. For best results, use a video with a single clearly visible character. If the video contains two or more characters, the motion of the character occupying the largest portion of the frame will be used for generation."},"character_orientation":{"type":"string","enum":["image","video"],"default":"video","description":"Generate the orientation of the character in the video, which can be selected to match the image or the video:\n- image: has the same orientation as the person in the picture; At this time, the reference video duration should not exceed 10 seconds;\n- video: consistent with the orientation of the characters in the video; At this time, the reference video duration should not exceed 30 seconds;"},"keep_audio":{"type":"boolean","default":true,"description":"Whether to keep the original audio from the video."},"mode":{"type":"string","enum":["std","pro"],"default":"std","description":"Video generation mode:\n- std: Standard Mode — basic, cost-effective.\n- pro: Professional Mode — higher quality, higher cost."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","video_url"],"title":"klingai/video-v2-6-motion-control, klingai/video-v3-motion-control"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v3-standard-text-to-video","klingai/video-v3-pro-text-to-video","klingai/video-v3-omni-720p-text-to-video","klingai/video-v3-omni-1080p-text-to-video","kling-video/v3/standard/text-to-video","kling-video/v3/pro/text-to-video"]},"prompt":{"type":"string","description":"Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both."},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"multi_prompt":{"type":"array","items":{"type":"string"},"description":"List of prompts for multi-shot video generation. If provided, overrides the single prompt and divides the video into multiple shots with specified prompts and durations."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"shot_type":{"type":"string","enum":["customize","intelligent","intelligence"],"default":"customize","description":"The type of multi-shot video generation"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"klingai/video-v3-standard-text-to-video, klingai/video-v3-pro-text-to-video, klingai/video-v3-omni-720p-text-to-video, klingai/video-v3-omni-1080p-text-to-video, kling-video/v3/standard/text-to-video, kling-video/v3/pro/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v3-standard-image-to-video","klingai/video-v3-pro-image-to-video","klingai/video-v3-omni-720p-image-to-video","klingai/video-v3-omni-1080p-image-to-video","kling-video/v3/standard/image-to-video","kling-video/v3/pro/image-to-video"]},"prompt":{"type":"string","description":"Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both."},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"multi_prompt":{"type":"array","items":{"type":"string"},"description":"List of prompts for multi-shot video generation. If provided, overrides the single prompt and divides the video into multiple shots with specified prompts and durations."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"tail_image_url":{"type":"string","format":"uri","description":"Last frame image URL. Not supported when generate_audio is enabled — set generate_audio to false to use a tail frame."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"elements":{"type":"array","items":{"type":"object","properties":{"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4,"description":"Additional reference images from different angles."},"frontal_image_url":{"type":"string","format":"uri","description":"The frontal image of the element (main view)."},"video_url":{"type":"string","format":"uri","description":"The video URL of the element. A request can only have one element with a video."}},"required":["reference_image_urls"]},"maxItems":4,"description":"Elements (characters/objects) to include in the video. Each example can either be an image set (frontal + reference images) or a video"},"shot_type":{"type":"string","enum":["customize","intelligent","intelligence"],"default":"customize","description":"The type of multi-shot video generation"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"klingai/video-v3-standard-image-to-video, klingai/video-v3-pro-image-to-video, klingai/video-v3-omni-720p-image-to-video, klingai/video-v3-omni-1080p-image-to-video, kling-video/v3/standard/image-to-video, kling-video/v3/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v3-standard-turbo-text-to-video","klingai/video-v3-turbo-pro-text-to-video","kling-video/v3/turbo/standard/text-to-video","kling-video/v3/turbo/pro/text-to-video"]},"prompt":{"type":"string","maxLength":3072,"description":"Optional text prompt. For best results keep the prompt under 2500 characters. Mutually exclusive with multi_prompt."},"multi_prompt":{"type":"array","nullable":true,"items":{"type":"object","properties":{"prompt":{"type":"string","maxLength":3072,"description":"Text prompt for this storyboard shot."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"}},"required":["prompt"]},"minItems":1,"maxItems":6,"description":"Multi-shot storyboard with 1 to 6 shots. Mutually exclusive with prompt."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"default":"16:9","description":"The aspect ratio of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"klingai/video-v3-standard-turbo-text-to-video, klingai/video-v3-turbo-pro-text-to-video, kling-video/v3/turbo/standard/text-to-video, kling-video/v3/turbo/pro/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v3-standard-turbo-image-to-video","klingai/video-v3-turbo-pro-image-to-video","kling-video/v3/turbo/standard/image-to-video","kling-video/v3/turbo/pro/image-to-video"]},"prompt":{"type":"string","maxLength":3072,"description":"Optional text prompt. For best results keep the prompt under 2500 characters. Mutually exclusive with multi_prompt."},"multi_prompt":{"type":"array","nullable":true,"items":{"type":"object","properties":{"prompt":{"type":"string","maxLength":3072,"description":"Text prompt for this storyboard shot."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"}},"required":["prompt"]},"minItems":1,"maxItems":6,"description":"Multi-shot storyboard with 1 to 6 shots. Mutually exclusive with prompt."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[3,4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"image_url":{"type":"string","format":"uri","description":"First-frame reference image. Formats: .jpg/.jpeg/.png; max 50MB; min 300px per side; aspect ratio within 1:2.5 to 2.5:1."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"klingai/video-v3-standard-turbo-image-to-video, klingai/video-v3-turbo-pro-image-to-video, kling-video/v3/turbo/standard/image-to-video, kling-video/v3/turbo/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v4-text-to-video","kling-video/v4/text-to-video"]},"prompt":{"type":"string","maxLength":2500,"description":"Text prompt for video generation. Mutually exclusive with multi_prompt."},"multi_prompt":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":512,"description":"Text prompt for this shot."},"duration":{"type":"integer","description":"Shot duration in seconds.","default":5}},"required":["prompt"]},"minItems":1,"description":"Per-shot prompts for multi-shot generation. Mutually exclusive with prompt. The video length is the sum of the shot durations (3-30 seconds in total)."},"duration":{"type":"integer","description":"Video duration in seconds (3-30). With multi_prompt the video length is the sum of the shot durations instead.","default":5},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","21:9"],"default":"16:9","description":"The aspect ratio of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"klingai/video-v4-text-to-video, kling-video/v4/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v4-image-to-video","kling-video/v4/image-to-video"]},"prompt":{"type":"string","maxLength":2500,"description":"Text prompt for video generation. Mutually exclusive with multi_prompt."},"multi_prompt":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":512,"description":"Text prompt for this shot."},"duration":{"type":"integer","description":"Shot duration in seconds.","default":5}},"required":["prompt"]},"minItems":1,"description":"Per-shot prompts for multi-shot generation. Mutually exclusive with prompt. The video length is the sum of the shot durations (3-30 seconds in total)."},"image_url":{"type":"string","format":"uri","description":"First frame of the video: a URL or a Base64 data URI. Max 30MB, at least 300px per side, aspect ratio 0.4-2.5. The output aspect ratio follows the input frames."},"tail_image_url":{"type":"string","format":"uri","description":"Last frame of the video (optional), with the same limits as image_url."},"duration":{"type":"integer","description":"Video duration in seconds (3-30). With multi_prompt the video length is the sum of the shot durations instead.","default":5},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"klingai/video-v4-image-to-video, kling-video/v4/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v4-reference-to-video","kling-video/v4/reference-to-video"]},"prompt":{"type":"string","maxLength":2500,"description":"Text prompt for video generation. Refer to the references as @Image1, @Image2, … and @Element1, @Element2, …. Mutually exclusive with multi_prompt."},"multi_prompt":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":512,"description":"Text prompt for this shot."},"duration":{"type":"integer","description":"Shot duration in seconds.","default":5}},"required":["prompt"]},"minItems":1,"description":"Per-shot prompts for multi-shot generation. Mutually exclusive with prompt. The video length is the sum of the shot durations (3-30 seconds in total)."},"image_url":{"type":"string","format":"uri","description":"Optional first frame of the video. It counts toward the 10-image limit of image_urls."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"Reference images, referred to in the prompt as @Image1, @Image2, … (up to 10). Max 30MB each, at least 300px per side, aspect ratio 0.4-2.5."},"elements":{"type":"array","items":{"type":"object","properties":{"frontal_image_url":{"type":"string","format":"uri","description":"Frontal (main) view of the element."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Additional views of the element from other angles (1-3)."}},"required":["frontal_image_url","reference_image_urls"]},"minItems":1,"maxItems":7,"description":"Characters or objects to keep consistent, referred to in the prompt as @Element1, @Element2, … (up to 7)."},"duration":{"type":"integer","description":"Video duration in seconds (3-30). With multi_prompt the video length is the sum of the shot durations instead.","default":5},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["auto","16:9","9:16","1:1","21:9"],"default":"16:9","description":"The aspect ratio of the generated video. `auto` follows the references."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"klingai/video-v4-reference-to-video, kling-video/v4/reference-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["klingai/video-v4-video-to-video-edit","kling-video/v4/video-to-video/edit"]},"prompt":{"type":"string","minLength":1,"maxLength":2500,"description":"Edit instruction. Refer to the source video as @Video1, to the reference images as @Image1, @Image2, … and to the elements as @Element1, @Element2, …."},"video_url":{"type":"string","format":"uri","description":"The video to edit: a URL or a Base64 data URI, 3-30 seconds, max 300MB, 700-4553px per side, aspect ratio 0.4-2.5, 24-60 fps. The edited video keeps its length."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"Reference images, referred to in the prompt as @Image1, @Image2, … (up to 10)."},"elements":{"type":"array","items":{"type":"object","properties":{"frontal_image_url":{"type":"string","format":"uri","description":"Frontal (main) view of the element."},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Additional views of the element from other angles (1-3)."}},"required":["frontal_image_url","reference_image_urls"]},"minItems":1,"maxItems":7,"description":"Characters or objects to put into the video, referred to in the prompt as @Element1, @Element2, … (up to 7)."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"klingai/video-v4-video-to-video-edit, kling-video/v4/video-to-video/edit"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v5/text-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The output video length in seconds. The 1080p quality option does not support 8-second videos.","enum":[5,8],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"style":{"type":"string","enum":["anime","3d_animation","clay","comic","cyberpunk"],"description":"The style of the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"lip_sync_tts_content":{"type":"string","description":"The text content to be lip-synced in the video."},"lip_sync_tts_speaker":{"type":"string","enum":["Harper","Ava","Isabella","Sophia","Emily","Chloe","Julia","Mason","Jack","Liam","James","Oliver","Adrian","Ethan","Auto"],"description":"A predefined system voice used for generating speech in the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"pixverse/v5/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v5/image-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the image to be used as the first frame of the video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The output video length in seconds. The 1080p quality option does not support 8-second videos.","enum":[5,8],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"style":{"type":"string","enum":["anime","3d_animation","clay","comic","cyberpunk"],"description":"The style of the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"lip_sync_tts_content":{"type":"string","description":"The text content to be lip-synced in the video."},"lip_sync_tts_speaker":{"type":"string","enum":["Harper","Ava","Isabella","Sophia","Emily","Chloe","Julia","Mason","Jack","Liam","James","Oliver","Adrian","Ethan","Auto"],"description":"A predefined system voice used for generating speech in the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"pixverse/v5/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v5/transition"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the image to be used as the first frame of the video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The output video length in seconds. The 1080p quality option does not support 8-second videos.","enum":[5,8],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"style":{"type":"string","enum":["anime","3d_animation","clay","comic","cyberpunk"],"description":"The style of the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"lip_sync_tts_content":{"type":"string","description":"The text content to be lip-synced in the video."},"lip_sync_tts_speaker":{"type":"string","enum":["Harper","Ava","Isabella","Sophia","Emily","Chloe","Julia","Mason","Jack","Liam","James","Oliver","Adrian","Ethan","Auto"],"description":"A predefined system voice used for generating speech in the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url","tail_image_url"],"title":"pixverse/v5/transition"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/lip-sync"]},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"audio_url":{"type":"string","format":"uri","description":"A direct link to an online audio file or a Base64-encoded local to an audio file used for lip-syncing in the video. Use either audio_url or (lip_sync_tts_speaker together with lip_sync_tts_content), but not both."},"lip_sync_tts_content":{"type":"string","description":"The text content to be lip-synced in the video. Use either audio_url or (lip_sync_tts_speaker together with lip_sync_tts_content), but not both."},"lip_sync_tts_speaker":{"type":"string","enum":["Harper","Ava","Isabella","Sophia","Emily","Chloe","Julia","Mason","Jack","Liam","James","Oliver","Adrian","Ethan","Auto"],"description":"A predefined system voice used for generating speech in the video. Use either audio_url or (lip_sync_tts_speaker together with lip_sync_tts_content), but not both."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url"],"title":"pixverse/lip-sync"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v5.5/text-to-video","pixverse/v5-5-text-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The output video length in seconds. The 1080p quality option does not support 8-second videos.","enum":[5,8,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"style":{"type":"string","enum":["anime","3d_animation","clay","comic","cyberpunk"],"description":"The style of the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"generate_audio_switch":{"type":"boolean","default":false,"description":"Enable audio generation.\n- true: Audio on.\n- false: Audio off."},"generate_multi_clip_switch":{"type":"boolean","default":false,"description":"Enable multi-clip generation with dynamic camera changes.\n- true: Multi-clip. \n- false: Single-clip."},"thinking_type":{"type":"string","enum":["enabled","disabled","auto"],"default":"enabled","description":"Prompt reasoning enhancement mode. \n- \"enabled\": Turn on prompt optimization. \n- \"disabled\": Turn off prompt optimization. \n- \"auto\" or omitted: Let the model decide automatically."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"pixverse/v5.5/text-to-video, pixverse/v5-5-text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v5.5/image-to-video","pixverse/v5-5-image-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the image to be used as the first frame of the video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The output video length in seconds. The 1080p quality option does not support 8-second videos.","enum":[5,8,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"style":{"type":"string","enum":["anime","3d_animation","clay","comic","cyberpunk"],"description":"The style of the generated video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"generate_audio_switch":{"type":"boolean","default":false,"description":"Enable audio generation.\n- true: Audio on.\n- false: Audio off."},"generate_multi_clip_switch":{"type":"boolean","default":false,"description":"Enable multi-clip generation with dynamic camera changes.\n- true: Multi-clip. \n- false: Single-clip."},"thinking_type":{"type":"string","enum":["enabled","disabled","auto"],"default":"enabled","description":"Prompt reasoning enhancement mode. \n- \"enabled\": Turn on prompt optimization. \n- \"disabled\": Turn off prompt optimization. \n- \"auto\" or omitted: Let the model decide automatically."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"pixverse/v5.5/image-to-video, pixverse/v5-5-image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v6-max/text-to-video"]},"prompt":{"type":"string","maxLength":5000,"description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","4:3","3:4","1:1","2:3","3:2","21:9"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","minimum":1,"maximum":15,"default":5,"description":"The length of the output video in seconds."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"generate_audio_switch":{"type":"boolean","default":false,"description":"Enable audio generation.\n- true: Audio on.\n- false: Audio off."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"pixverse/v6-max/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["pixverse/v6-max/image-to-video"]},"prompt":{"type":"string","maxLength":2048,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the image to be used as the first frame of the video."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","minimum":1,"maximum":15,"default":5,"description":"The length of the output video in seconds."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"generate_audio_switch":{"type":"boolean","default":false,"description":"Enable audio generation.\n- true: Audio on.\n- false: Audio off."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"pixverse/v6-max/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["ray-2","luma/ray-2","ray-flash-2","luma/ray-flash-2"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"resolution":{"type":"string","enum":["540p","720p","1080p","4k"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","21:9","9:21"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,9],"default":"5"},"keyframes":{"type":"object","properties":{"frame0":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["generation"]},"id":{"type":"string","format":"uuid"}},"required":["type","id"]},{"nullable":true}]},"frame1":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["generation"]},"id":{"type":"string","format":"uuid"}},"required":["type","id"]},{"nullable":true}]}},"description":"Keyframes for image-to-video, extend, or interpolate"},"loop":{"type":"boolean","default":false,"description":"Whether to loop the video"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"ray-2, luma/ray-2, ray-flash-2, luma/ray-flash-2"},{"type":"object","properties":{"model":{"type":"string","enum":["luma/ray-3.2"]},"prompt":{"type":"string","description":"Text description of the video to generate."},"type":{"type":"string","enum":["video","video_edit","video_reframe"],"default":"video","description":"Generation kind: \"video\" (generate / extend), \"video_edit\", or \"video_reframe\"."},"resolution":{"type":"string","enum":["360p","540p","720p","1080p"],"default":"720p","description":"Output resolution."},"duration":{"type":"integer","description":"Clip duration in seconds.","enum":[5,10],"default":"5"},"aspect_ratio":{"type":"string","enum":["9:16","3:4","1:1","4:3","16:9","21:9"],"default":"16:9","description":"Output aspect ratio."},"loop":{"type":"boolean","default":false,"description":"Seamlessly loop the video (creation only)."},"hdr":{"type":"boolean","default":false,"description":"Generate HDR output (5s, 720p/1080p only)."},"exr_export":{"type":"boolean","default":false,"description":"Export EXR frames (requires hdr)."},"image_url":{"type":"string","format":"uri","description":"Start-frame image URL for image-to-video / extend."},"last_image_url":{"type":"string","format":"uri","description":"End-frame image URL (first-last-frame)."},"video_url":{"type":"string","format":"uri","description":"Source video URL for editing or reframing."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"luma/ray-3.2"},{"type":"object","properties":{"model":{"type":"string","enum":["gen3a_turbo","runway/gen3a_turbo"]},"prompt":{"type":"string","maxLength":1000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A HTTPS URL or data URI containing an encoded image to be used as the first frame of the generated video."},"tail_image_url":{"type":"string","format":"uri","description":"A HTTPS URL or data URI containing an encoded image to be used as the last frame of the generated video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"gen3a_turbo, runway/gen3a_turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["gen4_turbo","runway/gen4_turbo"]},"prompt":{"type":"string","maxLength":1000,"description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A HTTPS URL or data URI containing an encoded image to be used as the first frame of the generated video."},"tail_image_url":{"type":"string","format":"uri","description":"A HTTPS URL or data URI containing an encoded image to be used as the last frame of the generated video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","4:3","3:4","1:1","21:9"],"default":"16:9","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"gen4_turbo, runway/gen4_turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["gen4_aleph","runway/gen4_aleph"]},"prompt":{"type":"string","maxLength":1000,"description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"references":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"]},"description":"Passing an image reference allows the model to emulate the style or content of the reference in the output."},"frame_size":{"type":"string","enum":["1280:720","720:1280","1104:832","832:1104","960:960","1584:672","848:480","640:480"],"default":"1280:720","description":"The width and height of the video."},"duration":{"type":"number","enum":[5],"default":5,"description":"The length of the output video in seconds."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"gen4_aleph, runway/gen4_aleph"},{"type":"object","properties":{"model":{"type":"string","enum":["act_two","runway/act_two"]},"character":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"A video of your character. In the output, the character will use the reference video performance in its original animated environment and some of the character's own movements."},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"An image of your character. In the output, the character will use the reference video performance in its original static environment."}],"description":"The character to control. You can either provide a video or an image. A visually recognizable face must be visible and stay within the frame."},"reference":{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"Passing a video reference allows the model to emulate the style or content of the reference in the output."},"frame_size":{"type":"string","enum":["1280:720","720:1280","1104:832","832:1104","960:960","1584:672","848:480","640:480"],"default":"1280:720","description":"The width and height of the video."},"body_control":{"type":"boolean","description":"A boolean indicating whether to enable body control. When enabled, non-facial movements and gestures will be applied to the character in addition to facial expressions."},"expression_intensity":{"type":"integer","minimum":1,"maximum":5,"default":3,"description":"An integer between 1 and 5 (inclusive). A larger value increases the intensity of the character's expression."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","character","reference"],"title":"act_two, runway/act_two"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/avatar-iii"]},"avatar_id":{"type":"string","minLength":1,"description":"ID of a HeyGen avatar look. This model accepts photo avatar and studio avatar looks."},"script":{"type":"string","minLength":1,"maxLength":5000,"description":"Text the avatar speaks (max 5000 characters). Provide either script or audio_url."},"voice_id":{"type":"string","description":"HeyGen voice ID used with script. Defaults to the avatar’s own voice."},"audio_url":{"type":"string","format":"uri","description":"URL of the audio the avatar lip-syncs to. Allowed formats: MP3, WAV; up to 30 minutes. The video lasts as long as the audio. Provide either script or audio_url."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:5","5:4","auto"],"default":"16:9","description":"\"auto\" keeps the aspect ratio of the source (16:9 when it cannot be read)."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"720p","description":"Output resolution. Does not change the price."},"voice_settings":{"type":"object","properties":{"speed":{"type":"number","minimum":0.5,"maximum":1.5,"default":1,"description":"Speech speed multiplier, from 0.5 to 1.5."},"pitch":{"type":"number","minimum":-50,"maximum":50,"default":0,"description":"Pitch shift, from -50 to 50."},"volume":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Volume, from 0 to 1."},"locale":{"type":"string","description":"Accent locale of the voice, for example \"en-US\"."}},"description":"Voice tuning for script. Ignored with audio_url."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","avatar_id"],"title":"heygen/avatar-iii"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/avatar-iv"]},"avatar_id":{"type":"string","minLength":1,"description":"ID of a HeyGen avatar look. This model accepts photo avatar looks."},"script":{"type":"string","minLength":1,"maxLength":5000,"description":"Text the avatar speaks (max 5000 characters). Provide either script or audio_url."},"voice_id":{"type":"string","description":"HeyGen voice ID used with script. Defaults to the avatar’s own voice."},"audio_url":{"type":"string","format":"uri","description":"URL of the audio the avatar lip-syncs to. Allowed formats: MP3, WAV; up to 30 minutes. The video lasts as long as the audio. Provide either script or audio_url."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:5","5:4","auto"],"default":"16:9","description":"\"auto\" keeps the aspect ratio of the source (16:9 when it cannot be read)."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"720p","description":"Output resolution. Does not change the price."},"voice_settings":{"type":"object","properties":{"speed":{"type":"number","minimum":0.5,"maximum":1.5,"default":1,"description":"Speech speed multiplier, from 0.5 to 1.5."},"pitch":{"type":"number","minimum":-50,"maximum":50,"default":0,"description":"Pitch shift, from -50 to 50."},"volume":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Volume, from 0 to 1."},"locale":{"type":"string","description":"Accent locale of the voice, for example \"en-US\"."}},"description":"Voice tuning for script. Ignored with audio_url."},"motion_prompt":{"type":"string","maxLength":1000,"description":"Natural-language direction for body motion and hand gestures (max 1000 characters)."},"expressiveness":{"type":"string","enum":["low","medium","high"],"default":"low","description":"Energy and range of facial and body movement."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","avatar_id"],"title":"heygen/avatar-iv"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/avatar-v"]},"avatar_id":{"type":"string","minLength":1,"description":"ID of a HeyGen avatar look. This model accepts photo avatar and digital twin looks."},"script":{"type":"string","minLength":1,"maxLength":5000,"description":"Text the avatar speaks (max 5000 characters). Provide either script or audio_url."},"voice_id":{"type":"string","description":"HeyGen voice ID used with script. Defaults to the avatar’s own voice."},"audio_url":{"type":"string","format":"uri","description":"URL of the audio the avatar lip-syncs to. Allowed formats: MP3, WAV; up to 30 minutes. The video lasts as long as the audio. Provide either script or audio_url."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:5","5:4","auto"],"default":"16:9","description":"\"auto\" keeps the aspect ratio of the source (16:9 when it cannot be read)."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"720p","description":"Output resolution. Does not change the price."},"voice_settings":{"type":"object","properties":{"speed":{"type":"number","minimum":0.5,"maximum":1.5,"default":1,"description":"Speech speed multiplier, from 0.5 to 1.5."},"pitch":{"type":"number","minimum":-50,"maximum":50,"default":0,"description":"Pitch shift, from -50 to 50."},"volume":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Volume, from 0 to 1."},"locale":{"type":"string","description":"Accent locale of the voice, for example \"en-US\"."}},"description":"Voice tuning for script. Ignored with audio_url."},"motion_prompt":{"type":"string","maxLength":1000,"description":"Natural-language direction for body motion and hand gestures (max 1000 characters)."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","avatar_id"],"title":"heygen/avatar-v"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/avatar-6","heygen/avatar-6-turbo"]},"image_url":{"type":"string","format":"uri","description":"URL of the photo to animate: one person with a clearly visible face. Up to 32 MB. The video keeps its aspect ratio."},"audio_url":{"type":"string","format":"uri","description":"URL of the speech the avatar performs. Allowed formats: MP3, WAV. The video lasts as long as the audio."},"resolution":{"type":"string","enum":["1080p","2k"],"default":"1080p","description":"Output resolution. The price per second depends on it."},"motion_prompt":{"type":"string","maxLength":1200,"description":"Natural-language direction for gestures, expression, posture and camera (max 1200 characters)."},"motion_expressiveness":{"type":"string","enum":["default","less"],"default":"default","description":"How much the avatar moves: \"less\" keeps head and body motion calmer. motion_prompt wins where the two overlap."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","audio_url"],"title":"heygen/avatar-6, heygen/avatar-6-turbo"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/image-to-video"]},"image_url":{"type":"string","format":"uri","description":"URL of the image to animate. Allowed formats: JPEG, PNG. The image must show a clear human face."},"script":{"type":"string","minLength":1,"maxLength":5000,"description":"Text the avatar speaks (max 5000 characters). Provide either script or audio_url."},"voice_id":{"type":"string","description":"HeyGen voice ID. Required with script."},"audio_url":{"type":"string","format":"uri","description":"URL of the audio the avatar lip-syncs to. Allowed formats: MP3, WAV; up to 30 minutes. The video lasts as long as the audio. Provide either script or audio_url."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:5","5:4","auto"],"default":"auto","description":"\"auto\" keeps the aspect ratio of the source (16:9 when it cannot be read)."},"resolution":{"type":"string","enum":["720p","1080p"],"default":"720p","description":"Output resolution. Does not change the price."},"voice_settings":{"type":"object","properties":{"speed":{"type":"number","minimum":0.5,"maximum":1.5,"default":1,"description":"Speech speed multiplier, from 0.5 to 1.5."},"pitch":{"type":"number","minimum":-50,"maximum":50,"default":0,"description":"Pitch shift, from -50 to 50."},"volume":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Volume, from 0 to 1."},"locale":{"type":"string","description":"Accent locale of the voice, for example \"en-US\"."}},"description":"Voice tuning for script. Ignored with audio_url."},"motion_prompt":{"type":"string","maxLength":1000,"description":"Natural-language direction for body motion and hand gestures (max 1000 characters)."},"expressiveness":{"type":"string","enum":["low","medium","high"],"default":"low","description":"Energy and range of facial and body movement."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"heygen/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/video-1-text-to-video"]},"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"Description of the video: subject, setting, camera, light and sound. Quote dialogue to have it spoken (max 32000 characters)."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"Aspect ratio of the video."},"resolution":{"type":"string","enum":["480p","768p","1080p","2k"],"default":"768p","description":"Output resolution. The price per second depends on it."},"duration":{"type":"integer","minimum":5,"maximum":30,"default":5,"description":"Video length in seconds, from 5 to 30. Billed per requested second."},"prompt_enhancement":{"type":"string","enum":["turbo","quality","ultraquality","disabled"],"default":"quality","description":"How much HeyGen rewrites the prompt before generation. \"ultraquality\" and \"disabled\" limit duration to 15 seconds."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Random seed (0–4294967295) for reproducibility."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"heygen/video-1-text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/video-1-image-to-video"]},"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"Description of the video: subject, setting, camera, light and sound. Quote dialogue to have it spoken (max 32000 characters)."},"image_url":{"type":"string","format":"uri","description":"URL of the first frame. The video keeps its aspect ratio. Allowed formats: JPEG, PNG, WEBP; up to 16 MB."},"resolution":{"type":"string","enum":["480p","768p","1080p","2k"],"default":"768p","description":"Output resolution. The price per second depends on it."},"duration":{"type":"integer","minimum":5,"maximum":30,"default":5,"description":"Video length in seconds, from 5 to 30. Billed per requested second."},"prompt_enhancement":{"type":"string","enum":["turbo","quality","ultraquality","disabled"],"default":"quality","description":"How much HeyGen rewrites the prompt before generation. \"ultraquality\" and \"disabled\" limit duration to 15 seconds."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Random seed (0–4294967295) for reproducibility."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"heygen/video-1-image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/video-1-reference-to-video"]},"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"Description of the video: subject, setting, camera, light and sound. Quote dialogue to have it spoken (max 32000 characters)."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"URLs of 1 to 9 reference images (people, objects, style) to build the video from. Allowed formats: JPEG, PNG, WEBP; up to 16 MB each."},"aspect_ratio":{"type":"string","enum":["adaptive","21:9","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive","description":"Aspect ratio of the video. \"adaptive\" follows the references."},"resolution":{"type":"string","enum":["480p","768p","1080p","2k"],"default":"768p","description":"Output resolution. The price per second depends on it."},"duration":{"type":"integer","minimum":5,"maximum":15,"default":5,"description":"Video length in seconds, from 5 to 15. Billed per requested second."},"prompt_enhancement":{"type":"string","enum":["turbo","quality","ultraquality","disabled"],"default":"quality","description":"How much HeyGen rewrites the prompt before generation. \"ultraquality\" and \"disabled\" limit duration to 15 seconds."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Random seed (0–4294967295) for reproducibility."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_urls"],"title":"heygen/video-1-reference-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/lipsync-speed","heygen/lipsync-precision"]},"video_url":{"type":"string","format":"uri","description":"URL of the video whose speaker gets the new audio. Allowed formats: MP4, MOV; up to 32 MB."},"audio_url":{"type":"string","format":"uri","description":"URL of the new audio the speaker lip-syncs to. Allowed formats: MP3, WAV; up to 32 MB. Its length must be within 15% of the video length, or the job fails (unbilled)."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url","audio_url"],"title":"heygen/lipsync-speed, heygen/lipsync-precision"},{"type":"object","properties":{"model":{"type":"string","enum":["heygen/video-translation-audio-only","heygen/video-translation-speed","heygen/video-translation-precision"]},"video_url":{"type":"string","format":"uri","description":"URL of the video to translate. Must be publicly reachable."},"output_language":{"type":"string","minLength":1,"description":"Language to translate into, by HeyGen name, for example \"Spanish (Spain)\" or \"Arabic\"."},"input_language":{"type":"string","minLength":1,"description":"Language spoken in the video, by HeyGen name. Detected when omitted."},"speaker_num":{"type":"integer","minimum":1,"description":"Number of speakers. Detected when omitted."},"disable_music_track":{"type":"boolean","default":false,"description":"Remove the background music from the result."},"enable_speech_enhancement":{"type":"boolean","default":false,"description":"Enhance the speech quality of the result."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url","output_language"],"title":"heygen/video-translation-audio-only, heygen/video-translation-speed, heygen/video-translation-precision"},{"type":"object","properties":{"model":{"type":"string","enum":["magic/text-to-video"]},"prompt":{"type":"string","description":"Text that will appear in the video."},"template":{"type":"string","enum":["Shanghai Drone Show"],"default":"Shanghai Drone Show","description":"Video design template."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"magic/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["magic/image-to-video"]},"image_url":{"type":"string","format":"uri","description":"An image (supplied via URL or Base64) that will be inserted into the selected video template as the embedded ad content."},"template":{"type":"string","enum":["Thailand Street","Times Square Billboard","New York Times Square (77)","Phone Social","Art Gallery","New York Times Square (66)","Dubai Museum","Digital Float","Rotating Cards","Desktop Reveal","Egypt Pyramid","Frames Drop","Cappadocia Balloons","Times Square Round Screen","Stockholm Metro","Tokyo Billboard","San Francisco Skyscrapers","Malaysia Shop","Las Vegas LED","Phone App","Paris Eiffel Tower"],"default":"Thailand Street","description":"Video design template."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"magic/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["magic/video-to-video"]},"video_url":{"type":"string","format":"uri","description":"A video (supplied via URL or Base64) that will be inserted into the selected video template as the embedded ad content."},"template":{"type":"string","enum":["Thailand Street","Times Square Billboard","New York Times Square (78)","Phone Social","Art Gallery","New York Times Square (67)","Dubai Museum","Rotating Cards","Desktop Reveal","Egypt Pyramid","Cappadocia Balloons","Times Square Round Screen","Stockholm Metro","Tokyo Billboard","San Francisco Skyscrapers","Malaysia Shop","Las Vegas LED","Phone App","Paris Eiffel Tower"],"default":"Thailand Street","description":"Video design template."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url"],"title":"magic/video-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1/standard/image-to-video","kling-video/v1.5/pro/image-to-video"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"static_mask":{"type":"string","format":"uri","description":"URL of the image for Static Brush Application Area (Mask image created by users using the motion brush)."},"dynamic_masks":{"type":"array","items":{"type":"object","properties":{"mask":{"type":"string","format":"uri"},"trajectories":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"integer"}},"required":["x","y"]},"minItems":2,"maxItems":77}},"required":["mask","trajectories"]},"maxItems":6,"description":"List of dynamic masks."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url"],"title":"kling-video/v1/standard/image-to-video, kling-video/v1.5/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v1/standard/text-to-video"]},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"description":"The aspect ratio of the generated video."},"camera_control":{"type":"string","enum":["down_back","forward_up","right_turn_forward","left_turn_forward"],"description":"Camera control parameters."},"advanced_camera_control":{"type":"object","properties":{"movement_type":{"type":"string","enum":["horizontal","vertical","pan","tilt","roll","zoom"],"default":"horizontal","description":"The type of camera movement."},"movement_value":{"type":"integer","minimum":-10,"maximum":10,"default":0,"description":"The value of the camera movement."}},"description":"Advanced camera control parameters."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"kling-video/v1/standard/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["kling-video/v2.1/pro/image-to-video"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"provider":{"type":"string","description":"Provider routing override. `kling` (alias `klingai`) runs native Kling with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Kling -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"negative_prompt":{"type":"string","description":"The description of elements to avoid in the generated video."},"cfg_scale":{"type":"number","minimum":0,"maximum":1,"description":"The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt."},"tail_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","prompt"],"title":"kling-video/v2.1/pro/image-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/omnihuman","bytedance/omnihuman/v1.5"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file for lip-sync animation. The model detects spoken parts and syncs the character's mouth to them. Audio must be under 30s long."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","audio_url"],"title":"bytedance/omnihuman, bytedance/omnihuman/v1.5"},{"type":"object","properties":{"model":{"type":"string","enum":["hunyuan-video-foley","tencent/hunyuan-video-foley"]},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"negative_prompt":{"type":"string","default":"noisy, harsh","description":"The description of elements to avoid in the generated video."},"guidance_scale":{"type":"number","default":4.5,"description":"Classifier-free guidance scale. Controls prompt adherence / creativity."},"num_inference_steps":{"type":"integer","default":50,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url"],"title":"hunyuan-video-foley, tencent/hunyuan-video-foley"},{"type":"object","properties":{"model":{"type":"string","enum":["kandinsky5/text-to-video","kandinsky5/text-to-video/distill","sber-ai/kandinsky5-t2v","sber-ai/kandinsky5-distill-t2v"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"aspect_ratio":{"type":"string","enum":["3:2","1:1","2:3"],"default":"3:2","description":"The aspect ratio of the generated video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[5,10],"default":"5"},"num_inference_steps":{"type":"integer","default":30,"description":"Number of inference steps for sampling. Higher values give better quality but take longer."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"kandinsky5/text-to-video, kandinsky5/text-to-video/distill, sber-ai/kandinsky5-t2v, sber-ai/kandinsky5-distill-t2v"},{"type":"object","properties":{"model":{"type":"string","enum":["krea-wan-14b/text-to-video","krea/krea-wan-14b/text-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"num_frames":{"type":"integer","minimum":18,"maximum":162,"default":78,"description":"Number of frames to generate. Must be a multiple of 12 plus 6, for example 18, 30, 42, etc."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"krea-wan-14b/text-to-video, krea/krea-wan-14b/text-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["krea-wan-14b/video-to-video","krea/krea-wan-14b/video-to-video"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"video_url":{"type":"string","format":"uri","description":"A HTTPS URL pointing to a video or a data URI containing a video. This video will be used as a reference during generation."},"strength":{"type":"number","minimum":0,"maximum":1,"default":0.85,"description":"Denoising strength for the video-to-video generation. 0.0 preserves the original, 1.0 completely remakes the video."},"enable_prompt_expansion":{"type":"boolean","default":true,"description":"Whether to enable prompt expansion."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"krea-wan-14b/video-to-video, krea/krea-wan-14b/video-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["ltxv-2","ltxv-2/image-to-video","ltxv-2/text-to-video","ltxv-2/fast","ltxv-2/image-to-video/fast","ltxv-2/text-to-video/fast","ltxv/ltxv-2","ltxv/ltxv-2-fast"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[6,8,10]},"resolution":{"type":"string","enum":["1080p","1440p","2160p"],"default":"1080p","description":"The resolution of the output video, where the number refers to the short side in pixels."},"aspect_ratio":{"type":"string","enum":["16:9"],"default":"16:9","description":"The aspect ratio of the generated video."},"fps":{"type":"integer","description":"Frames per second of the generated video.","enum":[25,50]},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"ltxv-2, ltxv-2/image-to-video, ltxv-2/text-to-video, ltxv-2/fast, ltxv-2/image-to-video/fast, ltxv-2/text-to-video/fast, ltxv/ltxv-2, ltxv/ltxv-2-fast"},{"type":"object","properties":{"model":{"type":"string","enum":["veed/fabric-1.0","veed/fabric-1.0/fast"]},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"audio_url":{"type":"string","format":"uri","description":"The URL of the audio file for lip-sync animation. The model detects spoken parts and syncs the character's mouth to them. Audio must be under 30s long."},"resolution":{"type":"string","enum":["480p","720p"],"default":"480p","description":"The resolution of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","image_url","audio_url"],"title":"veed/fabric-1.0, veed/fabric-1.0/fast"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-t2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"resolution":{"type":"string","enum":["hd","fhd"],"default":"hd","description":"The output resolution of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-3-video-t2v"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-i2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"image_url":{"type":"string","format":"uri","description":"The image URL that starts the clip."},"last_image_url":{"type":"string","format":"uri","description":"An optional image URL that pins the last frame of the clip. Provide it together with `image_url` to interpolate between the two."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Optional additional image URLs placed between the first and the last keyframe."},"resolution":{"type":"string","enum":["hd","fhd"],"default":"hd","description":"The output resolution of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"blackforestlabs/flux-3-video-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-v2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"video_url":{"type":"string","format":"uri","description":"The URL of the video to continue. The generated clip carries on from its final frames."},"resolution":{"type":"string","enum":["hd","fhd"],"default":"hd","description":"The output resolution of the generated video."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"blackforestlabs/flux-3-video-v2v"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-draft-t2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"resolution":{"type":"string","enum":["hd"],"default":"hd","description":"The output resolution of the generated video. Draft generations are hd-only; use the non-draft model for `fhd`."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"blackforestlabs/flux-3-video-draft-t2v"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-draft-i2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"image_url":{"type":"string","format":"uri","description":"The image URL that starts the clip."},"last_image_url":{"type":"string","format":"uri","description":"An optional image URL that pins the last frame of the clip. Provide it together with `image_url` to interpolate between the two."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Optional additional image URLs placed between the first and the last keyframe."},"resolution":{"type":"string","enum":["hd"],"default":"hd","description":"The output resolution of the generated video. Draft generations are hd-only; use the non-draft model for `fhd`."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","image_url"],"title":"blackforestlabs/flux-3-video-draft-i2v"},{"type":"object","properties":{"model":{"type":"string","enum":["blackforestlabs/flux-3-video-draft-v2v"]},"prompt":{"type":"string","minLength":1,"description":"The text prompt describing the video to generate."},"aspect_ratio":{"type":"string","enum":["auto","21:9","2:1","16:9","4:3","1:1","3:4","9:16"],"default":"auto","description":"The aspect ratio of the generated video. `auto` lets the model pick, and image-to-video follows the first keyframe."},"duration":{"type":"integer","minimum":5,"maximum":20,"default":5,"description":"The video length in whole seconds, from 5 to 20."},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate a synchronized audio track. Set to `false` for a silent clip."},"safety_tolerance":{"type":"integer","minimum":0,"maximum":4,"default":2,"description":"The moderation strictness, from 0 (strictest) to 4 (most permissive)."},"video_url":{"type":"string","format":"uri","description":"The URL of the video to continue. The generated clip carries on from its final frames."},"resolution":{"type":"string","enum":["hd"],"default":"hd","description":"The output resolution of the generated video. Draft generations are hd-only; use the non-draft model for `fhd`."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","video_url"],"title":"blackforestlabs/flux-3-video-draft-v2v"},{"type":"object","properties":{"model":{"type":"string","enum":["beeble/switchx-video-to-video","switchx-video-to-video"]},"video_url":{"type":"string","format":"uri","description":"URL of the source video to recomposite. Allowed formats: MP4, MOV (H.264 or HEVC), up to 240 frames. Source must not exceed 2,770,000 total pixels."},"alpha_url":{"type":"string","format":"uri","description":"URL of the alpha mask. Required when alpha_mode is \"custom\" or \"select\"; ignored for \"auto\" and \"fill\". A mask video for video-to-video, a mask image for image-to-image."},"reference_image_url":{"type":"string","format":"uri","description":"URL of the reference image defining the target look and lighting for the replaced region. Allowed formats: JPEG, PNG, WEBP. At least one of reference_image_url or prompt must be provided."},"alpha_mode":{"type":"string","enum":["auto","fill","custom","select"],"default":"auto","description":"Subject masking strategy: \"auto\" (AI auto-detects the subject), \"fill\" (no masking), \"select\" (propagate a mask from one keyframe), or \"custom\" (frame-by-frame mask supplied via alpha_url). Defaults to \"auto\"."},"max_resolution":{"type":"integer","description":"Maximum output resolution (longer side) in pixels: 720 or 1080. Defaults to 1080. 1080 costs more than 720.","enum":[720,1080],"default":"1080"},"alpha_keyframe_index":{"type":"integer","minimum":0,"description":"Frame index (0-based) whose mask is propagated when alpha_mode is \"select\" on a video. Defaults to the first frame. Ignored for image generation and for the auto, fill, and custom modes."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Random seed (0–4294967295) for reproducibility. Omit for a random seed. The seed used is always returned in the response."},"prompt":{"type":"string","maxLength":2000,"description":"Text description of the desired output to guide the generation (max 2000 characters). At least one of prompt or reference_image_url must be provided."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","video_url"],"title":"beeble/switchx-video-to-video, switchx-video-to-video"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution."},"video_url":{"type":"string","format":"uri","description":"URL of a Veo-generated MP4 to extend. Extension output is always 7 seconds; `duration` is forced to 7 when this field is set."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720P","1080P","4K"],"default":"720P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. When `video_url` is set (video extension), Google always returns a fixed 7-second extension; `duration` is forced to 7 and other values are ignored.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. `auto` (default) uses the full Tencent Cloud VOD -> native ByteDance -> fal.ai chain. `tencent_vod` is the only provider that accepts reference images containing real people (it registers them as assets first); pinning `bytedance` or `fal` sends the images straight to a provider that rejects them with \"the input image may contain real person\". Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p","1080p","4k"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev-router"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the source image to animate (image-to-video mode). Omit for text-to-video. Cannot be combined with `reference_images`."},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of reference image URLs (reference-to-video mode). Up to 7 images. Cannot be combined with `image_url`."},"duration":{"type":"integer","description":"The length of the output video in seconds.","minimum":1,"maximum":15,"default":10},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p"],"default":"480p","description":"Output video resolution.\nDefaults to 480p. Higher resolution increases the price per second."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14"],"description":"Always `typesafe/jev-1.14`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads PNG or JPEG of 280 to 1568 px a side. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `typesafe/jev-router` routes this request, always judged by `typesafe/jev-1.14`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"typesafe/jev-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution."},"video_url":{"type":"string","format":"uri","description":"URL of a Veo-generated MP4 to extend. Extension output is always 7 seconds; `duration` is forced to 7 when this field is set."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720P","1080P","4K"],"default":"720P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. When `video_url` is set (video extension), Google always returns a fixed 7-second extension; `duration` is forced to 7 and other values are ignored.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. `auto` (default) uses the full Tencent Cloud VOD -> native ByteDance -> fal.ai chain. `tencent_vod` is the only provider that accepts reference images containing real people (it registers them as assets first); pinning `bytedance` or `fal` sends the images straight to a provider that rejects them with \"the input image may contain real person\". Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p","1080p","4k"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["liquid/d1-router"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the source image to animate (image-to-video mode). Omit for text-to-video. Cannot be combined with `reference_images`."},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of reference image URLs (reference-to-video mode). Up to 7 images. Cannot be combined with `image_url`."},"duration":{"type":"integer","description":"The length of the output video in seconds.","minimum":1,"maximum":15,"default":10},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p"],"default":"480p","description":"Output video resolution.\nDefaults to 480p. Higher resolution increases the price per second."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["liquid/d1"],"description":"Always `liquid/d1`, the decision model this router is named for: leave it out. To choose another one, send the same `router` to `aimlapi/dynamic-router`. Every judgement is billed at its catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: it reads JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `liquid/d1-router` routes this request, always judged by `liquid/d1`: the same object `aimlapi/dynamic-router` takes, with its decision model fixed. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"liquid/d1-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override. `google` runs native Google with no fallback; `fal` runs the fal.ai mirror; `auto` (default) uses the Google -> fal.ai fallback chain. Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the first frame of the video. Should be 720p or higher resolution."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video. Should be 720p or higher resolution."},"video_url":{"type":"string","format":"uri","description":"URL of a Veo-generated MP4 to extend. Extension output is always 7 seconds; `duration` is forced to 7 when this field is set."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["720P","1080P","4K"],"default":"720P","description":"The resolution of the output video, where the number refers to the short side in pixels."},"duration":{"type":"integer","description":"The length of the output video in seconds. When `video_url` is set (video extension), Google always returns a fixed 7-second extension; `duration` is forced to 7 and other values are ignored.","enum":[4,6,8],"default":"8"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"person_generation":{"type":"string","enum":["dont_allow","allow_adult"],"default":"allow_adult","description":"Allow generation of people."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"provider":{"type":"string","description":"Provider routing override, pinning the request to one provider and disabling fallback. `auto` (default) uses the full Tencent Cloud VOD -> native ByteDance -> fal.ai chain. `tencent_vod` is the only provider that accepts reference images containing real people (it registers them as assets first); pinning `bytedance` or `fal` sends the images straight to a provider that rejects them with \"the input image may contain real person\". Case-insensitive.","example":"auto"},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."},"last_image_url":{"type":"string","format":"uri","description":"A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."},"audio_url":{"type":"string","format":"uri","description":"URL, Base64-encoded string or asset ID of the audio. The duration of the audio file specified in the parameter must not exceed 15.2 seconds. If audio is provided, at least one reference image or video is required."},"video_url":{"type":"string","format":"uri","description":"The public URL of the video. Only video URLs are supported."},"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":9,"description":"Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc."},"audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. If audio is provided, at least one reference image (image_urls) or video (video_urls) is required."},"video_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":3,"description":"Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."},"aspect_ratio":{"type":"string","enum":["21:9","16:9","4:3","1:1","3:4","9:16"],"default":"16:9","description":"The aspect ratio of the generated video. Defaults to 16:9 for text-to-video and reference-to-video requests. Must be omitted for first-frame / first-last-frame generation (`image_url`): the output aspect ratio follows the input image."},"resolution":{"type":"string","enum":["480p","720p","1080p","4k"],"default":"720p","description":"An enumeration where the short side of the video frame determines the resolution."},"duration":{"type":"integer","description":"The length of the output video in seconds.","enum":[4,5,6,7,8,9,10,11,12,13,14,15],"default":"5"},"generate_audio":{"type":"boolean","default":true,"description":"Whether to generate audio for the video."},"seed":{"type":"integer","description":"Varying the seed integer is a way to get different results for the same other request parameters. Using the same value for an identical request will produce similar results. If unspecified, a random number is chosen."},"watermark":{"type":"boolean","default":false,"description":"Whether the video contains a watermark."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"aimlapi/dynamic-router"},{"type":"object","properties":{"model":{"type":"string","enum":["aimlapi/dynamic-router"]},"prompt":{"type":"string","description":"The text description of the scene, subject, or action to generate in the video."},"image_url":{"type":"string","format":"uri","description":"URL of the source image to animate (image-to-video mode). Omit for text-to-video. Cannot be combined with `reference_images`."},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":7,"description":"Array of reference image URLs (reference-to-video mode). Up to 7 images. Cannot be combined with `image_url`."},"duration":{"type":"integer","description":"The length of the output video in seconds.","minimum":1,"maximum":15,"default":10},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"16:9","description":"The aspect ratio of the generated video."},"resolution":{"type":"string","enum":["480p","720p"],"default":"480p","description":"Output video resolution.\nDefaults to 480p. Higher resolution increases the price per second."},"router":{"type":"object","properties":{"decision_model":{"type":"string","enum":["typesafe/jev-1.14","typesafe/jev-1.13","typesafe/jev","liquid/d1","liquid/d1.1","liquid/d1-ultra"],"description":"The decision model that picks each request's bucket. Default `typesafe/jev-1.14`. `typesafe/jev` is always the newest Jev; name a version to stay on it. Only decision models are accepted here, never a model that answers. Every judgement is billed at that model's catalogue price and listed as its own request in your usage; turns that need none (tool results, a forced bucket, a single bucket) pay nothing for it. It is shown the request's images, up to 8 — billed as its input tokens — and never resizes one: Jev reads PNG or JPEG of 280 to 1568 px a side; the Liquid models JPEG, PNG or WebP, up to 10,000 patches of 32 × 32 px in all and 4.5 MiB per request. A request whose own images do not fit is refused with a 400 that says what to change, before anything is charged."},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","description":"The bucket's name, unique in the router: 1 to 32 letters, digits, `-`, `_` or `.`. Name it in `default_bucket` and `force_bucket`; the response's `meta.router.bucket` says which one answered."},"when":{"type":"string","minLength":1,"maxLength":500,"description":"What the requests this bucket takes look like, in your words (1 to 500 characters) — for example \"unsolicited advertising, prize claims or phishing\". The decision model picks the bucket whose `when` fits each request best. Required on every bucket when there are two or more; a single bucket has none."},"models":{"type":"array","items":{"anyOf":[{"type":"string","description":"A model id, as you would pass it in `model` (see `GET /v1/models`): a chat, image or video model."},{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false,"description":"The same model id, as an object: `{ \"model\": \"<id>\" }`."}],"description":"A model this bucket may answer with."},"maxItems":10,"description":"1 to 10 models, in the order to try them: the first one that can take the request (its tools, images, JSON schema and context size; on image and video generation, every input image field it sets) answers, and if it fails the next one does. Chat, image and video models side by side: a request takes the bucket's models of its own kind — a chat completion its chat models, an image generation its image models — and a bucket with none of its kind sends it on to the next bucket that has one (`meta.router.spilled_from`). Only models we serve — not routers, not decision models. Models you list run with your request's own settings, reasoning included. Or none (`[]`): a request the decision model puts in this bucket ends at the decision — no model is called, and the response is empty in its endpoint's shape (an assistant message with `content: \"\"` and `finish_reason: \"stop\"`; `data: []` for images; a video generation `completed` with `video: null`) and its `meta.router` says `\"routed\": false` and names the bucket, so your code acts on it. Only the judgement is charged. Not on a single bucket, which is never judged."}},"required":["name","models"],"additionalProperties":false,"description":"One bucket: its name, what it takes, and its models."},"minItems":1,"maxItems":10,"description":"Your buckets, 1 to 10: they replace the default buckets entirely. With two or more, each needs a `when`, and the decision model picks the one that fits each request. A single bucket is a fallback chain — every request goes to it, with no judgement. Left out: the default buckets — `light` (\"Needs little capability: greetings and small talk, one-line or lookup answers, common knowledge, short routine tasks such as a short piece of writing, a quick rewrite or simple arithmetic — a small, fast model answers it well\"): `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5`, `deepseek/deepseek-v4.1-flash`, `google/gemini-3-1-flash-lite`, `google/gemini-3-5-flash-lite`; `standard` (\"Needs a capable model: multi-step tasks that need care and accuracy\"): `openai/gpt-6.1-sol`, `anthropic/claude-sonnet-5.5`; `heavy` (\"Needs the strongest model: complex reasoning, hard math or proofs, large or tricky code, expert-level or research-grade knowledge\"): `anthropic/claude-opus-5.5`, `openai/gpt-6-astra` — which route conversations only (chat completions, the Responses API, the Messages API: on each, the models of a bucket served there); image and video requests need buckets of your own."},"default_bucket":{"type":"string","description":"Where a request goes when it is not judged — the decision model failed, timed out or named no bucket, or the request has no text — and where one goes when none of its bucket's models can take it, before the others are tried. Default: your first bucket; `standard` for the default buckets. Required when your first bucket lists no models: a request that is not judged would otherwise end there, unanswered by any model."},"force_bucket":{"type":"string","description":"Send the request to this bucket without judging it (nothing is charged for a judgement)."},"min_confidence":{"type":"number","minimum":0,"maximum":1,"description":"Below this confidence in its answer (0 to 1), a request goes to `default_bucket` instead (`meta.router.reason`: `unsure`) — for example, send what the decision model is unsure about to your strongest bucket. The judgement is still paid for. On a ladder an unsure turn never moves the conversation up, so a high value keeps conversations on the first rung: measured at 0.9, 40–45% of explicit conversations stayed there."},"ladder":{"type":"boolean","description":"Your buckets are a ladder's rungs: the first is the strictest, each next one more relaxed, and a last one may list no models (`models: []`), where a conversation ends. A conversation only moves down: each new turn — the previous reply and the new message — is judged against every rung, and the conversation goes to the lowest one it needs, and stays — never up: a rung above it keeps it where it is. It climbs back only once what moved it is gone from its history. Send each answer's `meta.router.state` back as `router.state`: with it only what is new is judged, and the conversation stays on its rung's model; without it, or when it does not fit the conversation, the whole conversation is judged again, two windows of 2,000 characters at a time, the newest first, at most 24 judgements — each billed as its own request; a conversation takes up to 5,000 messages, and a turn up to about 288,000 characters of new text. An unsure or failed judgement takes `default_bucket` but never moves a conversation up: name your last rung as `default_bucket` to fail closed. A turn returning tool results goes back to the model that made the calls, unjudged, while nothing new but the model's own calls comes with it. A model that cannot take a turn is passed over for one of a rung below, never above. `force_bucket` is not allowed. Only the user’s and the assistant’s messages are judged — their text and images — never your instructions (`system`) or tool results; an image the decision model cannot be shown (past its limits, or a link we could not store) takes `default_bucket`. A judgement that fails moves nothing for good: what it was to judge is judged again with the next turns, and given up on, at `default_bucket`, only after failing on its own three turns running.","example":true},"state":{"type":"string","maxLength":1024,"description":"With `ladder: true`: the previous answer's `meta.router.state`, unchanged. A Responses turn that continues a stored response (`previous_response_id`) needs none: the response keeps its own."}},"additionalProperties":false,"description":"How `aimlapi/dynamic-router` routes this request. Every setting is optional: left out, or `{}`, a conversation — chat completions, Responses, Messages — routes by the default buckets, like `typesafe/jev-router`; a setting you leave out keeps its default, and `buckets`, when given, are the whole table. The same `router` serves chat completions, the Responses API, the Messages API, image generation and editing, and video generation: the decision model judges the request's text — on media, its prompt — and its images, and the request takes the models of its own kind from the bucket. A conversation stays on its model while its turns land in the same bucket, and a turn returning tool results always goes back to the model that made the calls. A Responses turn that continues a stored response (`previous_response_id`) is judged like any other turn and runs only on a model served where that response is kept: it stays with the model that wrote it while it lands in that model's bucket, and a bucket with no models ends it at the decision. The response says where the request went in `meta.router` (`routed`, bucket, reason, the decision model's choice and confidence, the judgement, its charge and the images it was shown) and which model answered in `meta.model` — the router itself when the bucket lists no models; on video, on the submit's response; on a Messages stream, on its `message_stop` event. An invalid configuration is answered with a 400 that names each setting to fix, before anything is charged. In a multipart request (an image edit sending its picture as a file), send `router` as its JSON, in one text field.","example":{"decision_model":"typesafe/jev-1.14","buckets":[{"name":"check","when":"Spam, or might be spam: unsolicited adverts or offers, prizes or cash to claim, premium-rate numbers, phishing","models":["anthropic/claude-sonnet-5.5","openai/gpt-6.1-sol"]},{"name":"clean","when":"Plainly not spam: a personal message between people, or a notice the recipient expects","models":[]}],"min_confidence":0.9}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"aimlapi/dynamic-router"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the generated video.","example":"60ac7c34-3224-4b14-8e7d-0aa0db708325"},"status":{"type":"string","enum":["queued","generating","completed","error"],"description":"The current status of the generation task.","example":"completed"},"video":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"}},"required":["url"]},{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"}},"required":["url"]}},{"nullable":true}]},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"],"description":"Description of the error, if any."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]},"model":{"type":"string","description":"The model that answered — the one the router chose, or the next one in its bucket if that one failed. The router itself when the request ended at the decision (`router.routed: false`). Its rate is what the answer cost.","example":"anthropic/claude-sonnet-5.5"},"provider":{"type":"string","description":"The provider that served the answer; `aimlapi` when the request ended at the decision.","example":"anthropic"},"router":{"type":"object","properties":{"id":{"type":"string","description":"The router the request named.","example":"aimlapi/dynamic-router"},"routed":{"type":"boolean","description":"Whether a model answered. `false`: the request ended at the decision — `bucket` lists no models, so no model was called, the message is empty and nothing but the judgement was charged. Act on `bucket` (and `choice`, `confidence`).","example":true},"bucket":{"type":"string","description":"The bucket the request landed in: the one whose model answered — or, when `routed` is `false`, the one that ended it.","example":"check"},"spilled_from":{"type":"string","description":"The bucket the request was judged (or forced, or remembered) into, when none of its models could take the request — its tools, images, JSON schema or size — and a model of `bucket` answered instead."},"reason":{"type":"string","description":"Why it landed there: `classified` (judged), `sticky` (stayed on its conversation’s model — on a ladder, on its rung’s model, or at its last rung, with nothing new to judge), `forced` (`force_bucket`), `single_bucket`, `fallback_only` (listed behind a model that serves the request), `no_eligible_candidate`, `no_text`, `unsure` (judged below `min_confidence`), or a failed judgement — `classifier_timeout`, `classifier_error`, `classifier_unreadable`, `classifier_refused`, `classifier_circuit_open` — that took `default_bucket`.","example":"classified"},"decision_model":{"type":"string","description":"The decision model the router consults; none for a single bucket.","example":"typesafe/jev-1.14"},"choice":{"type":"string","description":"The bucket the decision model picked, when it answered with one — also when the request went elsewhere (`unsure`, `sticky`; on a ladder, a rung above the conversation’s keeps it where it is).","example":"check"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure the decision model was of `choice`, 0 to 1 — what `min_confidence` is held against.","example":0.98},"judgement":{"type":"object","properties":{"inference_id":{"type":"string","description":"The judgement’s own request: a row of its own in your usage, under the router’s name as `client`."},"credits":{"type":"number","description":"What the judgement was charged, in credits — on top of `meta.usage`, which counts only the answer. Images are input tokens of the decision model, so a judgement that is shown them costs more.","example":53},"images":{"type":"integer","minimum":0,"description":"How many of the request’s images the decision model was shown — at most 8: those of the latest user message (or of the media request), then those of the turns before it, newest first. An image it cannot read as sent (its type, its size) is refused with a 400 before anything is charged, never judged as if it were not there.","example":1},"images_unseen":{"type":"integer","minimum":0,"description":"How many of the request’s images it was not shown: an image given as a URL we could not store (send it inline, as a `data:` URL), an earlier turn’s image past the limits, or every image when the decision model reads text only. The judgement is of the rest, and of the text, which marks where each image was.","example":0}},"required":["inference_id","credits"],"additionalProperties":false,"description":"The decision model’s judgement of this request, when one was made: none for a forced bucket, a single bucket, a turn returning tool results, or a request with no text. A ladder turn judged in several pieces: the judgement that set the rung, with `credits` of them all (each is in `judgements`)."},"judgements":{"type":"array","items":{"type":"object","properties":{"inference_id":{"type":"string","description":"This judgement’s own request: a row of its own in your usage."},"credits":{"type":"number","description":"What this judgement was charged, in credits."},"messages":{"type":"array","items":{"type":"integer","minimum":0},"description":"The messages it judged: their positions in the list you sent — `messages` (chat completions, Messages) or `input` (Responses)."},"choice":{"type":"string","description":"The rung it picked for them."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure it was of `choice`, 0 to 1."}},"required":["inference_id","credits","messages"],"additionalProperties":false},"description":"A ladder turn judged in several pieces — a conversation judged afresh, an exchange at a time — lists every judgement here, each charged as its own request."},"state":{"type":"string","description":"A ladder’s state (`router.ladder`): where this conversation is on the ladder, and what of it was judged, signed for your account. Send it back unchanged as `router.state` with the next turn of the same conversation, and only what is new since — the previous reply and the new message — is judged. Opaque: a state that is changed, from another account or another ladder, or that comes with an edited, trimmed or branched history, counts as none, and the whole conversation is judged again. The Responses API keeps it with the response: a turn that continues one (`previous_response_id`) needs none.","example":"eyJ2IjoxLCJmIjoi…"},"trigger":{"type":"object","properties":{"message":{"type":"integer","minimum":0,"description":"The message whose exchange moved the conversation: its position in the list you sent it in — `messages` (chat completions, Messages) or `input` (Responses).","example":3},"bucket":{"type":"string","description":"The rung it moved the conversation to.","example":"mature"},"response":{"type":"string","description":"On the Responses API, the response whose input held that message — this one, or an earlier turn’s that this conversation continues."}},"required":["message","bucket"],"additionalProperties":false,"description":"What moved a ladder’s conversation to the rung it is on — the message to remove for it to climb back, once it is gone from the history. None while it is on the first rung."}},"required":["id","routed","reason"],"additionalProperties":false,"description":"How the router handled the request: where it went, why, and what the decision model answered."}},"required":["model","router"],"description":"Additional details about the answer — on a stream, on its last chunk."}},"required":["id","status"]}}}}}},"get":{"operationId":"_v2_video_generations","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["bytedance/seedance-1-0-pro","bytedance/seedance-1-0-pro-fast","bytedance/seedance-1-5-pro","bytedance/dreamina-seedance-2-0","bytedance/dreamina-seedance-2-0-fast","bytedance/dreamina-seedance-2-0-mini","bytedance/dreamina-seedance-2-5","bytedance/seedance-1-0-pro-t2v","bytedance/seedance-1-0-pro-i2v","bytedance/seedance-2-0-fast","bytedance/seedance-2.0/fast/image-to-video","bytedance/seedance-2.0/fast/reference-to-video","bytedance/seedance-2.0/fast/text-to-video","bytedance/seedance-2-0","bytedance/seedance-2.0/image-to-video","bytedance/seedance-2.0/reference-to-video","bytedance/seedance-2.0/text-to-video","bytedance/seedance-2-0-mini","bytedance/seedance-2-5","bytedance/seedance-2.5","veo-3.1-lite-generate-001","google/veo-3.1-lite-generate-001","veo-3.1-generate-001","google/veo-3.1-generate-001","veo-3.1-fast-generate-001","google/veo-3.1-fast-generate-001","gemini-omni-flash-preview","google/gemini-omni-flash-preview","gemini-omni-1.1-flash","google/gemini-omni-1.1-flash","gemini-omni-1.2-flash","google/gemini-omni-1.2-flash","google/veo-3.1-t2v","google/veo-3.1-i2v","google/veo-3.1-t2v-fast","google/veo-3.1-i2v-fast","google/veo-3.1-first-last-image-to-video","google/veo-3.1-reference-to-video","google/veo-3.1-first-last-image-to-video-fast","google/veo3-1-extend-video","google/veo3-1-fast-extend-video","google/veo-3-1-lite-generate-preview","wan2.1-t2v-plus","alibaba/wan2.1-t2v-plus","wan2.1-t2v-turbo","alibaba/wan2.1-t2v-turbo","wan2.2-i2v-plus","alibaba/wan2.2-i2v-plus","wan2.2-t2v-plus","alibaba/wan2.2-t2v-plus","wan2.5-t2v-preview","alibaba/wan2.5-t2v-preview","wan2.5-i2v-preview","alibaba/wan2.5-i2v-preview","wan2.6-t2v","alibaba/wan2.6-t2v","wan2.6-i2v","alibaba/wan2.6-i2v","wan2.6-i2v-flash","alibaba/wan2.6-i2v-flash","wan2.6-r2v","alibaba/wan2.6-r2v","wan2.7-t2v","alibaba/wan2.7-t2v","wan2.7-i2v","alibaba/wan2.7-i2v","wan2.7-r2v","alibaba/wan2.7-r2v","wan3.0-video","alibaba/wan3.0-video","custom:happyhorse-1.0","alibaba/custom:happyhorse-1.0","happyhorse-1.0-t2v","alibaba/happyhorse-1.0-t2v","happyhorse-1.0-i2v","alibaba/happyhorse-1.0-i2v","happyhorse-1.0-r2v","alibaba/happyhorse-1.0-r2v","happyhorse-1.0-video-edit","alibaba/happyhorse-1.0-video-edit","happyhorse-1.1-t2v","alibaba/happyhorse-1.1-t2v","happyhorse-1.1-i2v","alibaba/happyhorse-1.1-i2v","happyhorse-1.1-r2v","alibaba/happyhorse-1.1-r2v","custom:happyhorse-1.1","alibaba/custom:happyhorse-1.1","alibaba/wan2.2-vace-fun-a14b-depth","alibaba/wan2.2-vace-fun-a14b-pose","alibaba/wan2.2-vace-fun-a14b-inpainting","alibaba/wan2.2-vace-fun-a14b-outpainting","alibaba/wan2.2-vace-fun-a14b-reframe","alibaba/wan2.2-14b-animate-move","alibaba/wan2.2-14b-animate-replace","alibaba/wan-2-6-t2v","alibaba/wan-2-6-i2v","alibaba/wan-2-6-image-to-video-flash","alibaba/wan-2-6-r2v","alibaba/wan-2-7-t2v","alibaba/wan-2-7-i2v","alibaba/wan-2-7-r2v","alibaba/wan-3-0-video","alibaba/happyhorse-1-0","alibaba/happyhorse-1-1","alibaba/happyhorse-1-1-t2v","alibaba/happyhorse-1-1-i2v","alibaba/happyhorse-1-1-r2v","video-01","video-01-live2d","minimax/hailuo-02","minimax/hailuo-2.3","minimax/hailuo-2.3-fast","minimax/h3","minimax/h3-highspeed","MiniMax-H3-Highspeed","minimax/h3-lite","MiniMax-H3-Lite","minimax/h3-max","minimax/h3-max/image-to-video","minimax/h3-max/reference-to-video","minimax/h3-max/text-to-video","minimax/h3-max-recast","minimax/h3-max/recast","xai/grok-imagine-video","x-ai/grok-imagine-video","xai/grok-imagine-video-1.5-preview","x-ai/grok-imagine-video-1.5-preview","kling-video/v1/standard/image-to-video","kling-video/v1/standard/text-to-video","kling-video/v1/pro/image-to-video","kling-video/v1/pro/text-to-video","kling-video/v1.5/pro/image-to-video","kling-video/v1.5/pro/text-to-video","kling-video/v1.6/standard/text-to-video","kling-video/v1.6/standard/image-to-video","kling-video/v1.6/pro/image-to-video","kling-video/v1.6/pro/text-to-video","klingai/kling-video-v1.6-pro-effects","klingai/kling-video-v1.6-standard-effects","kling-video/v1.6/standard/multi-image-to-video","klingai/v2-master-image-to-video","klingai/v2-master-text-to-video","kling-video/v2.1/standard/image-to-video","klingai/v2.1-master-image-to-video","klingai/v2.1-master-text-to-video","kling-video/v2.1/pro/image-to-video","klingai/v2.5-turbo/pro/image-to-video","klingai/v2.5-turbo/pro/text-to-video","klingai/avatar-standard","klingai/avatar-pro","klingai/video-o1-image-to-video","klingai/video-o1-reference-to-video","klingai/video-o1-video-to-video-edit","klingai/video-o1-video-to-video-reference","klingai/video-v2-6-pro-image-to-video","klingai/video-v2-6-pro-text-to-video","klingai/video-v2-6-pro-motion-control","klingai/video-v2-6-motion-control","klingai/video-v3-standard-text-to-video","klingai/video-v3-standard-image-to-video","klingai/video-v3-pro-text-to-video","klingai/video-v3-pro-image-to-video","klingai/video-v3-omni-720p-text-to-video","klingai/video-v3-omni-720p-image-to-video","klingai/video-v3-omni-1080p-text-to-video","klingai/video-v3-omni-1080p-image-to-video","klingai/video-v3-standard-turbo-text-to-video","klingai/video-v3-standard-turbo-image-to-video","klingai/video-v3-turbo-pro-text-to-video","klingai/video-v3-turbo-pro-image-to-video","klingai/video-v3-motion-control","klingai/video-v4-text-to-video","klingai/video-v4-image-to-video","klingai/video-v4-reference-to-video","klingai/video-v4-video-to-video-edit","pixverse/v5/text-to-video","pixverse/v5/image-to-video","pixverse/v5/transition","pixverse/lip-sync","pixverse/v5.5/text-to-video","pixverse/v5-5-text-to-video","pixverse/v5.5/image-to-video","pixverse/v5-5-image-to-video","pixverse/v6-max/text-to-video","pixverse/v6-max/image-to-video","ray-2","luma/ray-2","ray-flash-2","luma/ray-flash-2","luma/ray-3.2","gen3a_turbo","runway/gen3a_turbo","gen4_turbo","runway/gen4_turbo","gen4_aleph","runway/gen4_aleph","act_two","runway/act_two","heygen/avatar-iii","heygen/avatar-iv","heygen/avatar-v","heygen/avatar-6","heygen/avatar-6-turbo","heygen/image-to-video","heygen/video-1-text-to-video","heygen/video-1-image-to-video","heygen/video-1-reference-to-video","heygen/lipsync-speed","heygen/lipsync-precision","heygen/video-translation-audio-only","heygen/video-translation-speed","heygen/video-translation-precision","magic/text-to-video","magic/image-to-video","magic/video-to-video","kling-video/v2.5-turbo/pro/image-to-video","kling-video/v2.5-turbo/pro/text-to-video","kling-video/v1/standard/ai-avatar","kling-video/v1/pro/ai-avatar","kling-video/o1/image-to-video","kling-video/o1/reference-to-video","kling-video/o1/video-to-video/edit","kling-video/o1/video-to-video/reference","kling-video/v2.6/pro/text-to-video","kling-video/v2.6/pro/image-to-video","kling-video/v2/master/image-to-video","kling-video/v2/master/text-to-video","kling-video/v2.1/master/image-to-video","kling-video/v2.1/master/text-to-video","kling-video/v3/standard/text-to-video","kling-video/v3/standard/image-to-video","kling-video/v3/pro/text-to-video","kling-video/v3/pro/image-to-video","kling-video/v3/turbo/standard/text-to-video","kling-video/v3/turbo/standard/image-to-video","kling-video/v3/turbo/pro/text-to-video","kling-video/v3/turbo/pro/image-to-video","kling-video/v4/text-to-video","kling-video/v4/image-to-video","kling-video/v4/reference-to-video","kling-video/v4/video-to-video/edit","veo3.1","veo3.1/image-to-video","veo3.1/first-last-frame-to-video","veo3.1/reference-to-video","veo3.1/fast","veo3.1/fast/image-to-video","veo3.1/fast/first-last-frame-to-video","veo3.1/extend-video","veo3.1/fast/extend-video","veo3.1/lite/image-to-video","veo3.1/lite/first-last-frame-to-video","veo3.1/lite","bytedance/omnihuman","bytedance/omnihuman/v1.5","hunyuan-video-foley","wan-22-vace-fun-a14b/depth","wan-22-vace-fun-a14b/pose","wan-22-vace-fun-a14b/inpainting","wan-22-vace-fun-a14b/outpainting","wan-22-vace-fun-a14b/reframe","wan/v2.2-14b/animate/move","wan/v2.2-14b/animate/replace","kandinsky5/text-to-video","kandinsky5/text-to-video/distill","krea-wan-14b/text-to-video","krea-wan-14b/video-to-video","ltxv-2","ltxv-2/image-to-video","ltxv-2/text-to-video","ltxv-2/fast","ltxv-2/image-to-video/fast","ltxv-2/text-to-video/fast","veed/fabric-1.0","veed/fabric-1.0/fast","tencent/hunyuan-video-foley","sber-ai/kandinsky5-t2v","sber-ai/kandinsky5-distill-t2v","krea/krea-wan-14b/text-to-video","krea/krea-wan-14b/video-to-video","ltxv/ltxv-2","ltxv/ltxv-2-fast","blackforestlabs/flux-3-video-t2v","blackforestlabs/flux-3-video-i2v","blackforestlabs/flux-3-video-v2v","blackforestlabs/flux-3-video-draft-t2v","blackforestlabs/flux-3-video-draft-i2v","blackforestlabs/flux-3-video-draft-v2v","beeble/switchx-video-to-video","switchx-video-to-video"]},"id":{"type":"string"}},"required":["model","id"],"title":"bytedance/seedance-1-0-pro, bytedance/seedance-1-0-pro-fast, bytedance/seedance-1-5-pro, bytedance/dreamina-seedance-2-0, bytedance/dreamina-seedance-2-0-fast, bytedance/dreamina-seedance-2-0-mini, bytedance/dreamina-seedance-2-5, bytedance/seedance-1-0-pro-t2v, bytedance/seedance-1-0-pro-i2v, bytedance/seedance-2-0-fast, bytedance/seedance-2.0/fast/image-to-video, bytedance/seedance-2.0/fast/reference-to-video, bytedance/seedance-2.0/fast/text-to-video, bytedance/seedance-2-0, bytedance/seedance-2.0/image-to-video, bytedance/seedance-2.0/reference-to-video, bytedance/seedance-2.0/text-to-video, bytedance/seedance-2-0-mini, bytedance/seedance-2-5, bytedance/seedance-2.5, veo-3.1-lite-generate-001, google/veo-3.1-lite-generate-001, veo-3.1-generate-001, google/veo-3.1-generate-001, veo-3.1-fast-generate-001, google/veo-3.1-fast-generate-001, gemini-omni-flash-preview, google/gemini-omni-flash-preview, gemini-omni-1.1-flash, google/gemini-omni-1.1-flash, gemini-omni-1.2-flash, google/gemini-omni-1.2-flash, google/veo-3.1-t2v, google/veo-3.1-i2v, google/veo-3.1-t2v-fast, google/veo-3.1-i2v-fast, google/veo-3.1-first-last-image-to-video, google/veo-3.1-reference-to-video, google/veo-3.1-first-last-image-to-video-fast, google/veo3-1-extend-video, google/veo3-1-fast-extend-video, google/veo-3-1-lite-generate-preview, wan2.1-t2v-plus, alibaba/wan2.1-t2v-plus, wan2.1-t2v-turbo, alibaba/wan2.1-t2v-turbo, wan2.2-i2v-plus, alibaba/wan2.2-i2v-plus, wan2.2-t2v-plus, alibaba/wan2.2-t2v-plus, wan2.5-t2v-preview, alibaba/wan2.5-t2v-preview, wan2.5-i2v-preview, alibaba/wan2.5-i2v-preview, wan2.6-t2v, alibaba/wan2.6-t2v, wan2.6-i2v, alibaba/wan2.6-i2v, wan2.6-i2v-flash, alibaba/wan2.6-i2v-flash, wan2.6-r2v, alibaba/wan2.6-r2v, wan2.7-t2v, alibaba/wan2.7-t2v, wan2.7-i2v, alibaba/wan2.7-i2v, wan2.7-r2v, alibaba/wan2.7-r2v, wan3.0-video, alibaba/wan3.0-video, custom:happyhorse-1.0, alibaba/custom:happyhorse-1.0, happyhorse-1.0-t2v, alibaba/happyhorse-1.0-t2v, happyhorse-1.0-i2v, alibaba/happyhorse-1.0-i2v, happyhorse-1.0-r2v, alibaba/happyhorse-1.0-r2v, happyhorse-1.0-video-edit, alibaba/happyhorse-1.0-video-edit, happyhorse-1.1-t2v, alibaba/happyhorse-1.1-t2v, happyhorse-1.1-i2v, alibaba/happyhorse-1.1-i2v, happyhorse-1.1-r2v, alibaba/happyhorse-1.1-r2v, custom:happyhorse-1.1, alibaba/custom:happyhorse-1.1, alibaba/wan2.2-vace-fun-a14b-depth, alibaba/wan2.2-vace-fun-a14b-pose, alibaba/wan2.2-vace-fun-a14b-inpainting, alibaba/wan2.2-vace-fun-a14b-outpainting, alibaba/wan2.2-vace-fun-a14b-reframe, alibaba/wan2.2-14b-animate-move, alibaba/wan2.2-14b-animate-replace, alibaba/wan-2-6-t2v, alibaba/wan-2-6-i2v, alibaba/wan-2-6-image-to-video-flash, alibaba/wan-2-6-r2v, alibaba/wan-2-7-t2v, alibaba/wan-2-7-i2v, alibaba/wan-2-7-r2v, alibaba/wan-3-0-video, alibaba/happyhorse-1-0, alibaba/happyhorse-1-1, alibaba/happyhorse-1-1-t2v, alibaba/happyhorse-1-1-i2v, alibaba/happyhorse-1-1-r2v, video-01, video-01-live2d, minimax/hailuo-02, minimax/hailuo-2.3, minimax/hailuo-2.3-fast, minimax/h3, minimax/h3-highspeed, MiniMax-H3-Highspeed, minimax/h3-lite, MiniMax-H3-Lite, minimax/h3-max, minimax/h3-max/image-to-video, minimax/h3-max/reference-to-video, minimax/h3-max/text-to-video, minimax/h3-max-recast, minimax/h3-max/recast, xai/grok-imagine-video, x-ai/grok-imagine-video, xai/grok-imagine-video-1.5-preview, x-ai/grok-imagine-video-1.5-preview, kling-video/v1/standard/image-to-video, kling-video/v1/standard/text-to-video, kling-video/v1/pro/image-to-video, kling-video/v1/pro/text-to-video, kling-video/v1.5/pro/image-to-video, kling-video/v1.5/pro/text-to-video, kling-video/v1.6/standard/text-to-video, kling-video/v1.6/standard/image-to-video, kling-video/v1.6/pro/image-to-video, kling-video/v1.6/pro/text-to-video, klingai/kling-video-v1.6-pro-effects, klingai/kling-video-v1.6-standard-effects, kling-video/v1.6/standard/multi-image-to-video, klingai/v2-master-image-to-video, klingai/v2-master-text-to-video, kling-video/v2.1/standard/image-to-video, klingai/v2.1-master-image-to-video, klingai/v2.1-master-text-to-video, kling-video/v2.1/pro/image-to-video, klingai/v2.5-turbo/pro/image-to-video, klingai/v2.5-turbo/pro/text-to-video, klingai/avatar-standard, klingai/avatar-pro, klingai/video-o1-image-to-video, klingai/video-o1-reference-to-video, klingai/video-o1-video-to-video-edit, klingai/video-o1-video-to-video-reference, klingai/video-v2-6-pro-image-to-video, klingai/video-v2-6-pro-text-to-video, klingai/video-v2-6-pro-motion-control, klingai/video-v2-6-motion-control, klingai/video-v3-standard-text-to-video, klingai/video-v3-standard-image-to-video, klingai/video-v3-pro-text-to-video, klingai/video-v3-pro-image-to-video, klingai/video-v3-omni-720p-text-to-video, klingai/video-v3-omni-720p-image-to-video, klingai/video-v3-omni-1080p-text-to-video, klingai/video-v3-omni-1080p-image-to-video, klingai/video-v3-standard-turbo-text-to-video, klingai/video-v3-standard-turbo-image-to-video, klingai/video-v3-turbo-pro-text-to-video, klingai/video-v3-turbo-pro-image-to-video, klingai/video-v3-motion-control, klingai/video-v4-text-to-video, klingai/video-v4-image-to-video, klingai/video-v4-reference-to-video, klingai/video-v4-video-to-video-edit, pixverse/v5/text-to-video, pixverse/v5/image-to-video, pixverse/v5/transition, pixverse/lip-sync, pixverse/v5.5/text-to-video, pixverse/v5-5-text-to-video, pixverse/v5.5/image-to-video, pixverse/v5-5-image-to-video, pixverse/v6-max/text-to-video, pixverse/v6-max/image-to-video, ray-2, luma/ray-2, ray-flash-2, luma/ray-flash-2, luma/ray-3.2, gen3a_turbo, runway/gen3a_turbo, gen4_turbo, runway/gen4_turbo, gen4_aleph, runway/gen4_aleph, act_two, runway/act_two, heygen/avatar-iii, heygen/avatar-iv, heygen/avatar-v, heygen/avatar-6, heygen/avatar-6-turbo, heygen/image-to-video, heygen/video-1-text-to-video, heygen/video-1-image-to-video, heygen/video-1-reference-to-video, heygen/lipsync-speed, heygen/lipsync-precision, heygen/video-translation-audio-only, heygen/video-translation-speed, heygen/video-translation-precision, magic/text-to-video, magic/image-to-video, magic/video-to-video, kling-video/v2.5-turbo/pro/image-to-video, kling-video/v2.5-turbo/pro/text-to-video, kling-video/v1/standard/ai-avatar, kling-video/v1/pro/ai-avatar, kling-video/o1/image-to-video, kling-video/o1/reference-to-video, kling-video/o1/video-to-video/edit, kling-video/o1/video-to-video/reference, kling-video/v2.6/pro/text-to-video, kling-video/v2.6/pro/image-to-video, kling-video/v2/master/image-to-video, kling-video/v2/master/text-to-video, kling-video/v2.1/master/image-to-video, kling-video/v2.1/master/text-to-video, kling-video/v3/standard/text-to-video, kling-video/v3/standard/image-to-video, kling-video/v3/pro/text-to-video, kling-video/v3/pro/image-to-video, kling-video/v3/turbo/standard/text-to-video, kling-video/v3/turbo/standard/image-to-video, kling-video/v3/turbo/pro/text-to-video, kling-video/v3/turbo/pro/image-to-video, kling-video/v4/text-to-video, kling-video/v4/image-to-video, kling-video/v4/reference-to-video, kling-video/v4/video-to-video/edit, veo3.1, veo3.1/image-to-video, veo3.1/first-last-frame-to-video, veo3.1/reference-to-video, veo3.1/fast, veo3.1/fast/image-to-video, veo3.1/fast/first-last-frame-to-video, veo3.1/extend-video, veo3.1/fast/extend-video, veo3.1/lite/image-to-video, veo3.1/lite/first-last-frame-to-video, veo3.1/lite, bytedance/omnihuman, bytedance/omnihuman/v1.5, hunyuan-video-foley, wan-22-vace-fun-a14b/depth, wan-22-vace-fun-a14b/pose, wan-22-vace-fun-a14b/inpainting, wan-22-vace-fun-a14b/outpainting, wan-22-vace-fun-a14b/reframe, wan/v2.2-14b/animate/move, wan/v2.2-14b/animate/replace, kandinsky5/text-to-video, kandinsky5/text-to-video/distill, krea-wan-14b/text-to-video, krea-wan-14b/video-to-video, ltxv-2, ltxv-2/image-to-video, ltxv-2/text-to-video, ltxv-2/fast, ltxv-2/image-to-video/fast, ltxv-2/text-to-video/fast, veed/fabric-1.0, veed/fabric-1.0/fast, tencent/hunyuan-video-foley, sber-ai/kandinsky5-t2v, sber-ai/kandinsky5-distill-t2v, krea/krea-wan-14b/text-to-video, krea/krea-wan-14b/video-to-video, ltxv/ltxv-2, ltxv/ltxv-2-fast, blackforestlabs/flux-3-video-t2v, blackforestlabs/flux-3-video-i2v, blackforestlabs/flux-3-video-v2v, blackforestlabs/flux-3-video-draft-t2v, blackforestlabs/flux-3-video-draft-i2v, blackforestlabs/flux-3-video-draft-v2v, beeble/switchx-video-to-video, switchx-video-to-video"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the generated video.","example":"60ac7c34-3224-4b14-8e7d-0aa0db708325"},"status":{"type":"string","enum":["queued","generating","completed","error"],"description":"The current status of the generation task.","example":"completed"},"video":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"}},"required":["url"]},{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"}},"required":["url"]}},{"nullable":true}]},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"],"description":"Description of the error, if any."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["id","status"]}}}}}}},"/v2/generate/audio":{"post":{"operationId":"_v2_generate_audio","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/eleven_music"]},"prompt":{"type":"string","maxLength":2000,"description":"A text description that can define the genre, mood, instruments, vocals, tempo, structure, and even lyrics of the track. It can be high-level (“peaceful meditation with voiceover”) or detailed (“solo piano in C minor, 90 BPM, raw and emotional”). Use keywords to control genre, emotional tone, vocals (e.g., a cappella, two singers harmonizing), structure (e.g., “lyrics begin at 15 seconds”), or provide custom lyrics directly in the prompt."},"music_length_ms":{"type":"integer","minimum":10000,"maximum":300000,"description":"Track length in milliseconds (10,000–300,000). If omitted, the model picks a length that suits the prompt.","format":"milliseconds"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"elevenlabs/eleven_music"},{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/eleven_music_v2_5"]},"prompt":{"type":"string","minLength":1,"maxLength":4100,"description":"What the track should sound like: genre, mood, instruments, vocals, structure.","example":"Upbeat synthwave with driving drums and a soaring lead, 120 BPM"},"music_length_ms":{"type":"integer","minimum":3000,"maximum":300000,"description":"Track length in milliseconds (3,000–300,000). If omitted, the model picks a length.","format":"milliseconds"},"force_instrumental":{"type":"boolean","description":"Generate the track without vocals."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"elevenlabs/eleven_music_v2_5"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/music-1.5"]},"prompt":{"type":"string","minLength":10,"maxLength":300,"description":"A description of the music, specifying style, mood, and scenario. Length: 10–300 characters."},"lyrics":{"type":"string","minLength":10,"maxLength":3000,"description":"Lyrics of the song. Use (\n) to separate lines. You may add structure tags like [Intro], [Verse], [Chorus], [Bridge], [Outro] to enhance the arrangement. Length: 10–3000 characters.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[Chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes"},"audio_setting":{"type":"object","properties":{"sample_rate":{"type":"integer","description":"The sampling rate of the generated music.","enum":[16000,24000,32000,44100],"default":"44100"},"bitrate":{"type":"integer","description":"The bit rate of the generated music.","enum":[32000,64000,128000,256000],"default":"256000"},"format":{"type":"string","enum":["mp3","wav","pcm"],"default":"mp3","description":"The format of the generated music."}}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","lyrics"],"title":"minimax/music-1.5"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/music-2.0"]},"prompt":{"type":"string","minLength":10,"maxLength":2000,"description":"A description of the music, specifying style, mood, and scenario. Length: 10–2000 characters."},"lyrics":{"type":"string","minLength":10,"maxLength":3000,"description":"Lyrics of the song. Use (\n) to separate lines. You may add structure tags like [Intro], [Verse], [Chorus], [Bridge], [Outro] to enhance the arrangement. Length: 10–3000 characters.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[Chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes"},"audio_setting":{"type":"object","properties":{"sample_rate":{"type":"integer","description":"The sampling rate of the generated music.","enum":[16000,24000,32000,44100],"default":"44100"},"bitrate":{"type":"integer","description":"The bit rate of the generated music.","enum":[32000,64000,128000,256000],"default":"256000"},"format":{"type":"string","enum":["mp3","wav","pcm"],"default":"mp3","description":"The format of the generated music."}}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","lyrics"],"title":"minimax/music-2.0"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/music-2.6"]},"prompt":{"type":"string","maxLength":2000,"description":"A description of the music, specifying style, mood, and scenario. Length: 10–2000 characters."},"lyrics":{"type":"string","maxLength":3000,"description":"Lyrics of the song. Use (\n) to separate lines. You may add structure tags like [Intro], [Verse], [Chorus], [Bridge], [Outro] to enhance the arrangement. Length: 10–3000 characters.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[Chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes"},"audio_setting":{"type":"object","properties":{"sample_rate":{"type":"integer","description":"The sampling rate of the generated music.","enum":[16000,24000,32000,44100],"default":"44100"},"bitrate":{"type":"integer","description":"The bit rate of the generated music.","enum":[32000,64000,128000,256000],"default":"256000"},"format":{"type":"string","enum":["mp3","wav","pcm"],"default":"mp3","description":"The format of the generated music."}}},"lyrics_optimizer":{"type":"boolean","default":false,"description":"Whether to automatically generate lyrics based on the prompt description. When set to true and lyrics is empty, the system will automatically generate lyrics from the prompt."},"is_instrumental":{"type":"boolean","default":false,"description":"Whether to generate instrumental music (no vocals). When set to true, the lyrics field is not required."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"minimax/music-2.6"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax/music-cover"]},"prompt":{"type":"string","minLength":10,"maxLength":2000,"description":"A description of the music, specifying style, mood, and scenario. Length: 10–2000 characters."},"reference_audio_url":{"type":"string","format":"uri","description":"A URL or a Base64-encoded of the reference audio. Reference audio constraints:\n- Duration: 6 seconds to 6 minutes\n- Size: max 50 MB\n- Format: common audio formats (mp3, wav, flac, etc.)\n- Must contain vocals: purely instrumental tracks are rejected, because the cover is built from the detected vocal melody\nPrefer a Base64 data URI or a fast CDN URL: the provider downloads an external URL itself, so a slow host adds its download time to the request.\nMutually exclusive with cover_feature_id.\n"},"cover_feature_id":{"type":"string","minLength":1,"description":"Identifier of preprocessed reference-audio features, obtained from POST /v2/generate/audio/preprocess. Two-step flow: call the preprocess endpoint, review or edit the formatted_lyrics it returns, then send them here as lyrics together with this id. Valid for 24 hours. Mutually exclusive with reference_audio_url; requires lyrics."},"lyrics":{"type":"string","minLength":10,"maxLength":3000},"audio_setting":{"type":"object","properties":{"sample_rate":{"type":"integer","description":"The sampling rate of the generated music.","enum":[16000,24000,32000,44100],"default":"44100"},"bitrate":{"type":"integer","description":"The bit rate of the generated music.","enum":[32000,64000,128000,256000],"default":"256000"},"format":{"type":"string","enum":["mp3","wav","pcm"],"default":"mp3","description":"The format of the generated music."}}},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"minimax/music-cover"},{"type":"object","properties":{"model":{"type":"string","enum":["lyria2","google/lyria2"]},"prompt":{"type":"string","description":"Lyrics with optional formatting. You can use a newline to separate each line of lyrics. You can use two newlines to add a pause between lines. You can use double hash marks (##) at the beginning and end of the lyrics to add accompaniment. Maximum 600 characters."},"negative_prompt":{"type":"string","description":"A description of what to exclude from the generated audio"},"seed":{"type":"integer","minimum":0,"description":"A seed for deterministic generation. If provided, the model will attempt to produce the same audio given the same prompt and other parameters."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"lyria2, google/lyria2"},{"type":"object","properties":{"model":{"type":"string","enum":["minimax-music"]},"prompt":{"type":"string","description":"Lyrics with optional formatting. You can use a newline to separate each line of lyrics. You can use two newlines to add a pause between lines. You can use double hash marks (##) at the beginning and end of the lyrics to add accompaniment. Maximum 600 characters."},"reference_audio_url":{"type":"string","format":"uri","description":"Reference song, should contain music and vocals. Must be a .wav or .mp3 file longer than 15 seconds."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","reference_audio_url"],"title":"minimax-music"},{"type":"object","properties":{"model":{"type":"string","enum":["stable-audio"]},"prompt":{"type":"string","description":"The prompt to generate audio."},"seconds_start":{"type":"integer","maximum":47,"minimum":1,"description":"The start point of the audio clip to generate."},"seconds_total":{"type":"integer","maximum":47,"minimum":1,"default":30,"description":"The duration of the audio clip to generate."},"steps":{"type":"integer","minimum":1,"maximum":1000,"default":100,"description":"The number of steps to denoise the audio."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt"],"title":"stable-audio"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v9.5"]},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"Song lyrics. Section tags such as [Verse] and [Chorus] are supported. Without lyrics the song is made from the prompt.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\n[Chorus]\nPushing the wooden door, the aroma spreads"},"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Style, mood, instruments and vocals. Required without lyrics; with lyrics it steers the style (up to 1,024 characters).","example":"warm indie folk, acoustic guitar, soft female vocals"},"styles":{"type":"array","items":{"type":"string","enum":["pop","rock","jazz","r&b","edm","ambient","folk","latin","k-pop","j-pop","house","gospel","lo-fi"]},"minItems":1,"description":"Genres for a song made from a prompt. Not allowed with lyrics."},"gender":{"type":"string","enum":["female","male"],"description":"Preferred vocal gender. Applies only with lyrics."},"duration":{"type":"integer","minimum":120,"maximum":300,"description":"Target length in seconds (120–300). Applies only with lyrics; otherwise the model decides."},"n":{"type":"integer","minimum":1,"maximum":3,"default":1,"description":"How many variants to generate (1–3). Each variant is a separate song and is charged as one."},"reference_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `reference`."},"melody_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `melody`."},"vocal_id":{"type":"string","description":"A `vocal_id` from mureka/vocal-clone: the song is sung in that voice."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"mureka/v9.5"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v9.5"]},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"Song lyrics. Section tags such as [Verse] and [Chorus] are supported. With lyrics the song costs $0.15.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\n[Chorus]\nPushing the wooden door, the aroma spreads"},"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Style, mood, instruments and vocals. Required without lyrics (then the song costs $0.50); with lyrics it steers the style, up to 1,024 characters.","example":"warm indie folk, acoustic guitar, soft female vocals"},"styles":{"type":"array","items":{"type":"string","enum":["pop","rock","jazz","r&b","edm","ambient","folk","latin","k-pop","j-pop","house","gospel","lo-fi"]},"minItems":1,"description":"Genres for a song made from a prompt. Not allowed with lyrics."},"gender":{"type":"string","enum":["female","male"],"description":"Preferred vocal gender."},"duration":{"type":"integer","minimum":120,"maximum":300,"description":"Target length in seconds (120–300). If omitted, the model decides."},"n":{"type":"number"},"reference_id":{"type":"string"},"melody_id":{"type":"string"},"vocal_id":{"type":"string"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"mureka/v9.5"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v9.5/instrumental"]},"prompt":{"type":"string","minLength":1,"maxLength":1024,"description":"Style, mood and instruments of the track (up to 1,024 characters).","example":"calm lo-fi beat with soft piano and vinyl crackle"},"instrumental_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `instrumental`: a reference track to follow instead of a prompt."},"n":{"type":"integer","minimum":1,"maximum":3,"default":1,"description":"How many variants to generate (1–3). Each variant is a separate song and is charged as one."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"mureka/v9.5/instrumental"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v8/extend"]},"song_id":{"type":"string","description":"A `song_id` from an earlier result of a Mureka model (songs[].song_id). Mureka accepts songs from the last month."},"upload_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `audio`."},"lyrics":{"type":"string","minLength":1,"maxLength":3000,"description":"Lyrics for the added part."},"extend_at":{"type":"integer","minimum":0,"description":"Where the new part starts, in milliseconds from the start of the song. A value past the end means the end."},"extend_type":{"type":"string","enum":["tail","head"],"default":"tail","description":"`tail` continues the song after `extend_at`; `head` adds a new beginning before it."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","lyrics","extend_at"],"title":"mureka/v8/extend"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v8/remix"]},"song_id":{"type":"string","description":"A `song_id` from an earlier result of a Mureka model (songs[].song_id). Mureka accepts songs from the last month."},"upload_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `remix`."},"prompt":{"type":"string","minLength":1,"maxLength":1024,"description":"How the remix should sound (up to 1,024 characters)."},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"The lyrics the remix sings (up to 5,000 characters)."},"n":{"type":"integer","minimum":1,"maximum":3,"default":1,"description":"How many variants to generate (1–3). Each variant is a separate song and is charged as one."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","prompt","lyrics"],"title":"mureka/v8/remix"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/v9.5/remix"]},"url":{"type":"string","description":"The song to remix: an https URL (for example songs[].url of a mureka/v9.5 result) or a base64 data URI. MP3 or M4A, 10 to 480 seconds; vocal-only, accompaniment-only and instrumental tracks work."},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"The complete lyrics of the remix, up to 5,000 characters. The remix follows them, so short lyrics make a short song. Section tags such as [Verse] and [Chorus] are supported.","example":"[Verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\n[Chorus]\nPushing the wooden door, the aroma spreads"},"prompt":{"type":"string","minLength":1,"maxLength":1024,"description":"Genre, mood, instruments, arrangement and vocal gender of the remix, up to 1,024 characters.","example":"upbeat synth pop, bright female vocals, driving drums"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","url","lyrics","prompt"],"title":"mureka/v9.5/remix"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/region-edit"]},"song_id":{"type":"string","description":"A `song_id` from an earlier result of a Mureka model (songs[].song_id). Mureka accepts songs from the last month."},"upload_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `audio`."},"lyrics":{"type":"string","minLength":1,"maxLength":3000,"description":"New lyrics sung in the edited span."},"edit_start":{"type":"integer","minimum":0,"description":"Start of the span to regenerate, in milliseconds."},"edit_end":{"type":"integer","minimum":0,"description":"End of the span, in milliseconds; at least 3 seconds after edit_start."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","lyrics","edit_start","edit_end"],"title":"mureka/region-edit"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/stem","mureka/describe"]},"url":{"type":"string","description":"The song: an https URL (for example songs[].url of an earlier result) or a base64 data URI. MP3 or M4A, up to 10 MB."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model","url"],"title":"mureka/stem, mureka/describe"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/transcribe"]},"song_id":{"type":"string","description":"A `song_id` from an earlier result of a Mureka model (songs[].song_id). Mureka accepts songs from the last month."},"upload_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `audio`."},"url":{"type":"string","description":"The song as an https URL or a base64 data URI (MP3, WAV or M4A, 10 seconds to 10 minutes)."},"title":{"type":"string","minLength":1,"maxLength":50,"description":"Title printed on the sheet music (up to 50 characters)."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"mureka/transcribe"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/recognize"]},"upload_id":{"type":"string","description":"An `upload_id` from mureka/file-upload with purpose `audio`."},"url":{"type":"string","description":"The song as an https URL or a base64 data URI: MP3 or M4A, up to 10 MB."},"webhook_url":{"type":"string","maxLength":2048,"format":"uri","description":"A public https address on port 443 or 8443 that gets a signed POST when the job ends. Needs a signing secret: POST /v1/webhooks/secret. On /v1/responses it needs `background: true` and does not work with `store: false`. On /v1/images/generations it runs the generation as a task on the models that support it (the others answer 400 webhook_url_not_supported): the answer is { id, status } and the result is read with GET /v1/images/generations/{id}.","example":"https://client.example/hooks/aiml"}},"required":["model"],"title":"mureka/recognize"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the generated audio.","example":"60ac7c34-3224-4b14-8e7d-0aa0db708325"},"status":{"type":"string","enum":["queued","generating","completed","error"],"description":"The current status of the generation task.","example":"completed"},"audio_file":{"type":"object","nullable":true,"properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hippopotamus/1757963033314-8ca7729d-b78c-4d4c-9ef9-89b2fb3d07e8.mp3"}},"required":["url"]},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"],"description":"Description of the error, if any."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["id","status"]}}}}}},"get":{"operationId":"_v2_generate_audio","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["elevenlabs/eleven_music","elevenlabs/eleven_music_v2_5","minimax/music-1.5","minimax/music-2.0","minimax/music-2.6","minimax/music-cover","lyria2","minimax-music","stable-audio","google/lyria2","mureka/v9.5","mureka/v9.5/instrumental","mureka/v8/extend","mureka/v8/remix","mureka/v9.5/remix","mureka/region-edit","mureka/stem","mureka/describe","mureka/transcribe","mureka/recognize"]},"id":{"type":"string"}},"required":["model","id"],"title":"elevenlabs/eleven_music, elevenlabs/eleven_music_v2_5, minimax/music-1.5, minimax/music-2.0, minimax/music-2.6, minimax/music-cover, lyria2, minimax-music, stable-audio, google/lyria2, mureka/v9.5, mureka/v9.5/instrumental, mureka/v8/extend, mureka/v8/remix, mureka/v9.5/remix, mureka/region-edit, mureka/stem, mureka/describe, mureka/transcribe, mureka/recognize"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the generated audio.","example":"60ac7c34-3224-4b14-8e7d-0aa0db708325"},"status":{"type":"string","enum":["queued","generating","completed","error"],"description":"The current status of the generation task.","example":"completed"},"audio_file":{"type":"object","nullable":true,"properties":{"url":{"type":"string","format":"uri","description":"The URL where the file can be downloaded from.","example":"https://cdn.aimlapi.com/generations/hippopotamus/1757963033314-8ca7729d-b78c-4d4c-9ef9-89b2fb3d07e8.mp3"}},"required":["url"]},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"],"description":"Description of the error, if any."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["id","status"]}}}}}}},"/v1/ocr":{"post":{"operationId":"_v1_ocr","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["gc-document-ai","google/gc-document-ai"]},"document":{"anyOf":[{"type":"string","format":"uri"},{"type":"string"}],"description":"The document file to be processed by the OCR model."},"mimeType":{"type":"string","enum":["application/pdf","image/gif","image/tiff","image/jpeg","image/png","image/bmp","image/webp","text/html"],"description":"The MIME type of the document."},"pages":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["start"]},"start":{"type":"integer","minimum":1}},"required":["type","start"]},{"type":"object","properties":{"type":{"type":"string","enum":["end"]},"end":{"type":"integer","minimum":1}},"required":["type","end"]},{"type":"object","properties":{"type":{"type":"string","enum":["range"]},"start":{"type":"integer","minimum":1},"end":{"type":"integer","minimum":2}},"required":["type","start","end"]},{"type":"object","properties":{"type":{"type":"string","enum":["indices"]},"indices":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":15}},"required":["type","indices"]}],"description":"Specific pages you wants to process"}},"required":["model","document"],"title":"gc-document-ai, google/gc-document-ai"},{"type":"object","properties":{"model":{"type":"string","enum":["glm-ocr","zhipu/glm-ocr"]},"document":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["document_url"],"description":"Type of document."},"document_url":{"type":"string","format":"uri","description":"URL of a document file to be processed by the OCR model. Supported file formats: PDF ≤ 50MB."}},"required":["type","document_url"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"],"description":"Image URL."},"image_url":{"type":"string","format":"uri","description":"URL of a single image to be processed by the OCR model. Supported file formats: JPG, PNG. Single image ≤10MB."}},"required":["type","image_url"]}],"description":"Document to run OCR."},"pages":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"integer"}}],"description":"Specific pages to process, e.g. \"3\", \"0-2\", [0, 3, 4]."},"include_image_base64":{"type":"boolean","description":"Include base64 images in response."},"image_limit":{"type":"integer","description":"Max images to extract."},"image_min_size":{"type":"integer","description":"Minimum height and width of image to extract"},"return_crop_images":{"type":"boolean","description":"Whether to return screenshot information."},"need_layout_visualization":{"type":"boolean","description":"Whether to return detailed layout image result information."}},"required":["model","document"],"title":"glm-ocr, zhipu/glm-ocr"},{"type":"object","properties":{"model":{"type":"string","enum":["mistral-ocr-latest","mistral/mistral-ocr-latest","mistral-ocr-2512","mistral/mistral-ocr-2512","mistral-ocr-4-0","mistral/mistral-ocr-4-0","mistral-ocr-3","mistral/mistral-ocr-3","mistral-ocr-4","mistral/mistral-ocr-4"]},"document":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["document_url"],"description":"Type of document."},"document_url":{"type":"string","format":"uri","description":"Document URL."}},"required":["type","document_url"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"],"description":"Image URL."},"image_url":{"type":"string","format":"uri","description":"Type of document."}},"required":["type","image_url"]}],"description":"Document to run OCR"},"pages":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"integer"}},{"nullable":true}],"description":"Specific pages you wants to process","example":"\"3\" or \"0-2\" or [0, 3, 4]"},"include_image_base64":{"type":"boolean","nullable":true,"description":"Include base64 images in response"},"image_limit":{"type":"integer","nullable":true,"description":"Max images to extract"},"image_min_size":{"type":"integer","nullable":true,"description":"Minimum height and width of image to extract"},"bbox_annotation_format":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"description":{"type":"string","nullable":true},"strict":{"type":"boolean","nullable":true}},"required":["name","schema"]}},"required":["type","json_schema"],"description":"JSON schema to structure the annotation of each extracted bounding box (figures, charts, images). Using any annotation format switches the request to the annotated-page rate."},"document_annotation_format":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"description":{"type":"string","nullable":true},"strict":{"type":"boolean","nullable":true}},"required":["name","schema"]}},"required":["type","json_schema"],"description":"JSON schema to extract structured data from the whole document. Using any annotation format switches the request to the annotated-page rate."},"document_annotation_prompt":{"type":"string","nullable":true,"description":"Optional high-level prompt to guide and instruct how the document is annotated."}},"required":["model","document"],"title":"mistral-ocr-latest, mistral/mistral-ocr-latest, mistral-ocr-2512, mistral/mistral-ocr-2512, mistral-ocr-4-0, mistral/mistral-ocr-4-0, mistral-ocr-3, mistral/mistral-ocr-3, mistral-ocr-4, mistral/mistral-ocr-4"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","description":"The page index in a PDF document starting from 0"},"markdown":{"type":"string","description":"The markdown string response of the page"},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Image ID for extracted image in a page"},"top_left_x":{"type":"integer","nullable":true,"description":"X coordinate of top-left corner of the extracted image"},"top_left_y":{"type":"integer","nullable":true,"description":"Y coordinate of top-left corner of the extracted image"},"bottom_right_x":{"type":"integer","nullable":true,"description":"X coordinate of bottom-right corner of the extracted image"},"bottom_right_y":{"type":"integer","nullable":true,"description":"Y coordinate of bottom-right corner of the extracted image"},"image_base64":{"type":"string","nullable":true,"format":"uri","description":"Base64 string of the extracted image"}},"required":["id","top_left_x","top_left_y","bottom_right_x","bottom_right_y"]},"description":"List of all extracted images in the page"},"dimensions":{"type":"object","nullable":true,"properties":{"dpi":{"type":"integer","description":"Dots per inch of the page-image."},"height":{"type":"integer","description":"Height of the image in pixels."},"width":{"type":"integer","description":"Width of the image in pixels."}},"required":["dpi","height","width"],"description":"The dimensions of the PDF page's screenshot image"}},"required":["index","markdown","images","dimensions"]},"description":"List of OCR info for pages"},"model":{"type":"string","description":"The model used to generate the OCR."},"document_annotation":{"type":"string","nullable":true,"description":"Structured annotation of the whole document as a JSON string, returned when document_annotation_format is provided."},"usage_info":{"type":"object","properties":{"pages_processed":{"type":"integer","description":"Number of pages processed"},"doc_size_bytes":{"type":"integer","nullable":true,"description":"Document size in bytes"}},"required":["pages_processed","doc_size_bytes"],"description":"Usage info for the OCR request."},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation.","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["pages","model","usage_info"]}}}}}}},"/v2/generate/audio/preprocess":{"post":{"operationId":"_v2_generate_audio_preprocess","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"model":{"type":"string","enum":["minimax/music-cover"]},"reference_audio_url":{"type":"string","format":"uri","description":"A URL or a Base64-encoded data URI of the reference audio to analyze. Reference audio constraints:\n- Duration: 6 seconds to 6 minutes\n- Size: max 50 MB\n- Format: common audio formats (mp3, wav, flac, etc.)\n- Must contain vocals: purely instrumental tracks are rejected, because the cover is built from the detected vocal melody\nPrefer a Base64 data URI or a fast CDN URL: the provider downloads an external URL itself, so a slow host adds its download time to the request.\nThe analysis result (cover_feature_id) is valid for 24 hours; pass it to POST /v2/generate/audio together with lyrics to generate the cover."}},"required":["model","reference_audio_url"],"title":"minimax/music-cover"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/file-upload"]},"purpose":{"type":"string","enum":["reference","melody","instrumental","audio","remix"],"description":"What the file is for: `reference` (style reference, 30 s used) → reference_id; `melody` (5–60 s, MP3, M4A or MIDI) → melody_id; `instrumental` (30 s) → instrumental_id; `audio` → upload_id of extend, region edit, transcribe and recognize; `remix` (a full song of 10–350 s) → upload_id of mureka/v8/remix. MP3 or M4A unless noted."},"file":{"type":"string","description":"The file: an https URL or a base64 data URI, up to 10 MB."}},"required":["model","purpose","file"],"title":"mureka/file-upload"},{"type":"object","properties":{"model":{"type":"string","enum":["mureka/vocal-clone"]},"file":{"type":"string","description":"A 15–30 second voice sample (MP3 or M4A, under 10 MB): an https URL or a base64 data URI. Use only a voice you have the right to clone."},"description":{"type":"string","minLength":1,"maxLength":1024,"description":"A note about the voice (up to 1,024 characters)."}},"required":["model","file"],"title":"mureka/vocal-clone"}]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"cover_feature_id":{"type":"string","description":"Identifier of the preprocessed reference-audio features. Valid for 24 hours and only within this platform. Pass it to POST /v2/generate/audio instead of reference_audio_url, together with lyrics."},"formatted_lyrics":{"type":"string","description":"Lyrics recognized from the reference audio, formatted with section tags such as [Verse] and [Chorus]. Review or edit them and pass as lyrics in the generation call."},"structure_result":{"type":"string","description":"Detected song structure as a raw JSON string (segment types and timestamps), exactly as returned by the provider."},"audio_duration":{"type":"number","description":"Duration of the reference audio in seconds."}},"required":["cover_feature_id","formatted_lyrics","structure_result","audio_duration"]},{"type":"object","additionalProperties":{"nullable":true}}]}}}}}}},"/v1/images/generations/:generation_id":{"get":{"operationId":"_v1_images_generations_:generation_id","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["flux/dev","flux/schnell","flux-pro","flux-pro/v1.1","flux-pro/v1.1-ultra","blackforestlabs/flux-2-pro","flux-2-pro","blackforestlabs/flux-2-pro-preview","blackforestlabs/flux-2-max","blackforestlabs/flux-2-flex","blackforestlabs/flux-2-klein-9b","blackforestlabs/flux-2-klein-4b","blackforestlabs/flux-pro-1.1","blackforestlabs/flux-pro-1.1-ultra"]},"id":{"type":"string"}},"required":["model","id"],"title":"flux/dev, flux/schnell, flux-pro, flux-pro/v1.1, flux-pro/v1.1-ultra, blackforestlabs/flux-2-pro, flux-2-pro, blackforestlabs/flux-2-pro-preview, blackforestlabs/flux-2-max, blackforestlabs/flux-2-flex, blackforestlabs/flux-2-klein-9b, blackforestlabs/flux-2-klein-4b, blackforestlabs/flux-pro-1.1, blackforestlabs/flux-pro-1.1-ultra"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The generation id. Read the result with GET /v1/images/generations/{id}.","example":"60ac7c34-3224-4b14-8e7d-0aa0db708325"},"status":{"type":"string","enum":["queued","generating","completed","error"],"description":"queued, generating, completed or error.","example":"completed"},"data":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"}},"required":["url"]},"description":"The generated images, once completed."},"error":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"message":{"type":"string"}},"required":["name","message"]},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","example":120000},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD.","example":0.06}},"required":["credits_used","usd_spent"]}}}},"required":["id","status"]}}}}}}},"/v1/batches/{batch_id}":{"get":{"operationId":"_v1_batches_get","summary":"Retrieve a batch","description":"An id of the deprecated inline format (no `batch_` prefix) answers as `GET /v1/batches?batch_id=` does, not with this object.","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"batch_V1StGXR8_Z5jdHi6B-myT"},"object":{"type":"string","enum":["batch"]},"endpoint":{"type":"string","enum":["/v1/chat/completions"]},"model":{"type":"string"},"errors":{"type":"object","nullable":true,"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string","nullable":true},"line":{"type":"integer","nullable":true}}}}}},"input_file_id":{"type":"string"},"completion_window":{"type":"string","enum":["24h"]},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"]},"output_file_id":{"type":"string","nullable":true},"error_file_id":{"type":"string","nullable":true},"created_at":{"type":"integer"},"in_progress_at":{"type":"integer","nullable":true},"expires_at":{"type":"integer"},"finalizing_at":{"type":"integer","nullable":true},"completed_at":{"type":"integer","nullable":true},"failed_at":{"type":"integer","nullable":true},"expired_at":{"type":"integer","nullable":true},"cancelling_at":{"type":"integer","nullable":true},"cancelled_at":{"type":"integer","nullable":true},"request_counts":{"type":"object","description":"Expired and cancelled lines count as failed.","properties":{"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}},"usage":{"type":"object","nullable":true,"properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"output_tokens":{"type":"integer"},"output_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}},"total_tokens":{"type":"integer"}}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/batches/{batch_id}/cancel":{"post":{"operationId":"_v1_batches_cancel","summary":"Cancel a batch","description":"Lines finished before the cancel are returned and charged. A refused cancel answers 502 and the batch keeps running. An id of the deprecated inline format (no `batch_` prefix) answers as `POST /v1/batches/cancel/{batch_id}` does, not with this object.","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"batch_V1StGXR8_Z5jdHi6B-myT"},"object":{"type":"string","enum":["batch"]},"endpoint":{"type":"string","enum":["/v1/chat/completions"]},"model":{"type":"string"},"errors":{"type":"object","nullable":true,"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string","nullable":true},"line":{"type":"integer","nullable":true}}}}}},"input_file_id":{"type":"string"},"completion_window":{"type":"string","enum":["24h"]},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"]},"output_file_id":{"type":"string","nullable":true},"error_file_id":{"type":"string","nullable":true},"created_at":{"type":"integer"},"in_progress_at":{"type":"integer","nullable":true},"expires_at":{"type":"integer"},"finalizing_at":{"type":"integer","nullable":true},"completed_at":{"type":"integer","nullable":true},"failed_at":{"type":"integer","nullable":true},"expired_at":{"type":"integer","nullable":true},"cancelling_at":{"type":"integer","nullable":true},"cancelled_at":{"type":"integer","nullable":true},"request_counts":{"type":"object","description":"Expired and cancelled lines count as failed.","properties":{"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"}}},"usage":{"type":"object","nullable":true,"properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"output_tokens":{"type":"integer"},"output_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}},"total_tokens":{"type":"integer"}}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"409":{"description":"The object is in a state that does not allow this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"502":{"description":"The provider refused or failed the cancel; the batch keeps running and its hold stays","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/files":{"post":{"operationId":"_v1_files_create","summary":"Upload a batch input file, up to 50 MiB","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","purpose"],"properties":{"file":{"type":"string","format":"binary"},"purpose":{"type":"string","enum":["batch"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"413":{"description":"The file is over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"429":{"description":"A limit on active batches, lines or open uploads; see `Retry-After`","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}},"get":{"operationId":"_v1_files_list","summary":"List your files","parameters":[{"name":"purpose","in":"query","required":false,"schema":{"type":"string","enum":["batch","batch_output"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"after","in":"query","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}}}},"has_more":{"type":"boolean"},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/files/{file_id}":{"get":{"operationId":"_v1_files_get","summary":"Retrieve file metadata","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}},"delete":{"operationId":"_v1_files_delete","summary":"Delete a file","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"deleted":{"type":"boolean"}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"409":{"description":"The object is in a state that does not allow this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/files/{file_id}/content":{"get":{"operationId":"_v1_files_content","summary":"Read file content","description":"Redirects to a signed link that lives five minutes.","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to the content"},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/uploads":{"post":{"operationId":"_v1_uploads_create","summary":"Start a multipart upload of a batch input file, up to 200 MiB","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","purpose","bytes","mime_type"],"properties":{"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch"]},"bytes":{"type":"integer"},"mime_type":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["upload"]},"bytes":{"type":"integer"},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch"]},"status":{"type":"string"},"file":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}},"nullable":true}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"413":{"description":"The file is over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"429":{"description":"A limit on active batches, lines or open uploads; see `Retry-After`","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/uploads/{upload_id}/parts":{"post":{"operationId":"_v1_uploads_parts","summary":"Get a signed link for a part, or register an uploaded part","description":"Unlike OpenAI, the bytes do not go in this request. Send `part_number` to get a `url`, PUT the bytes there, then pass the returned ETag here or to `complete`. Every part but the last must be at least 5 MiB.","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["part_number"],"properties":{"part_number":{"type":"integer","minimum":1,"maximum":10000},"etag":{"type":"string"},"bytes":{"type":"integer"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"part_number":{"type":"integer"},"url":{"type":"string"},"etag":{"type":"string"}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/uploads/{upload_id}/complete":{"post":{"operationId":"_v1_uploads_complete","summary":"Finish an upload","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","required":["part_number","etag"],"properties":{"part_number":{"type":"integer"},"etag":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["upload"]},"bytes":{"type":"integer"},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch"]},"status":{"type":"string"},"file":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}},"nullable":true}}}}}},"400":{"description":"The request or the input file is invalid; `code` and `param` name the cause","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"413":{"description":"The file is over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}},"/v1/uploads/{upload_id}/cancel":{"post":{"operationId":"_v1_uploads_cancel","summary":"Cancel an upload","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["upload"]},"bytes":{"type":"integer"},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch"]},"status":{"type":"string"},"file":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer","nullable":true},"filename":{"type":"string"},"purpose":{"type":"string","enum":["batch","batch_output"]},"status":{"type":"string","enum":["processed"]},"status_details":{"type":"string","nullable":true}},"nullable":true}}}}}},"404":{"description":"No such object for this caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}}}}}}}