Skip to content

Responses API

The Responses API provides an OpenAI Responses-compatible interface for secure LLM interactions. It supports function calling, multi-turn conversations via previous_response_id, reasoning models, and streaming.

ResponsesResource

ResponsesResource(transport: ControlSyncTransport)

OpenAI Responses API — client.control.responses.

Methods:

  • create

    Send a Responses API request through Sequrity's secure orchestrator.

create

create(
    model: str,
    *,
    input: str | list | None = None,
    instructions: str | None = None,
    tools: list[ToolParam | dict] | None = None,
    tool_choice: Literal["none", "auto", "required"]
    | ToolChoiceFunctionParam
    | dict
    | None = None,
    stream: Literal[True],
    temperature: float | None = None,
    top_p: float | None = None,
    max_output_tokens: int | None = None,
    reasoning: ReasoningParam | dict | None = None,
    text: ResponseTextConfigParam | dict | None = None,
    metadata: dict[str, str] | None = None,
    previous_response_id: str | None = None,
    include: list[str] | None = None,
    store: bool | None = None,
    truncation: Literal["auto", "disabled"] | None = None,
    parallel_tool_calls: bool | None = None,
    max_tool_calls: int | None = None,
    background: bool | None = None,
    conversation: str | ConversationParam | dict | None = None,
    prompt: ResponsePromptParam | dict | None = None,
    service_tier: Literal["auto", "default", "flex", "scale", "priority"] | None = None,
    stream_options: StreamOptionsParam | dict | None = None,
    top_logprobs: int | None = None,
    timeout: float | None = None,
    provider: LlmServiceProvider | LlmServiceProviderStr | None | _NotGiven = NOT_GIVEN,
    llm_api_key: str | None | _NotGiven = NOT_GIVEN,
    features: FeaturesHeader | None | _NotGiven = NOT_GIVEN,
    security_policy: SecurityPolicyHeader | None | _NotGiven = NOT_GIVEN,
    fine_grained_config: FineGrainedConfigHeader | None | _NotGiven = NOT_GIVEN,
    endpoint_type: str | _NotGiven = NOT_GIVEN,
    session_id: str | None | _NotGiven = NOT_GIVEN,
    feature_overrides: dict[str, Any] | None = None,
    policy_overrides: dict[str, Any] | None = None,
    config_overrides: dict[str, Any] | None = None,
    custom_headers: dict[str, str] | None = None,
) -> SyncStream[OpenAiResponseStreamEvent]
create(
    model: str,
    *,
    input: str | list | None = None,
    instructions: str | None = None,
    tools: list[ToolParam | dict] | None = None,
    tool_choice: Literal["none", "auto", "required"]
    | ToolChoiceFunctionParam
    | dict
    | None = None,
    stream: Literal[False] | None = None,
    temperature: float | None = None,
    top_p: float | None = None,
    max_output_tokens: int | None = None,
    reasoning: ReasoningParam | dict | None = None,
    text: ResponseTextConfigParam | dict | None = None,
    metadata: dict[str, str] | None = None,
    previous_response_id: str | None = None,
    include: list[str] | None = None,
    store: bool | None = None,
    truncation: Literal["auto", "disabled"] | None = None,
    parallel_tool_calls: bool | None = None,
    max_tool_calls: int | None = None,
    background: bool | None = None,
    conversation: str | ConversationParam | dict | None = None,
    prompt: ResponsePromptParam | dict | None = None,
    service_tier: Literal["auto", "default", "flex", "scale", "priority"] | None = None,
    stream_options: StreamOptionsParam | dict | None = None,
    top_logprobs: int | None = None,
    timeout: float | None = None,
    provider: LlmServiceProvider | LlmServiceProviderStr | None | _NotGiven = NOT_GIVEN,
    llm_api_key: str | None | _NotGiven = NOT_GIVEN,
    features: FeaturesHeader | None | _NotGiven = NOT_GIVEN,
    security_policy: SecurityPolicyHeader | None | _NotGiven = NOT_GIVEN,
    fine_grained_config: FineGrainedConfigHeader | None | _NotGiven = NOT_GIVEN,
    endpoint_type: str | _NotGiven = NOT_GIVEN,
    session_id: str | None | _NotGiven = NOT_GIVEN,
    feature_overrides: dict[str, Any] | None = None,
    policy_overrides: dict[str, Any] | None = None,
    config_overrides: dict[str, Any] | None = None,
    custom_headers: dict[str, str] | None = None,
) -> ResponsesResponse
create(
    model: str,
    *,
    input: str | list | None = None,
    instructions: str | None = None,
    tools: list[ToolParam | dict] | None = None,
    tool_choice: Literal["none", "auto", "required"]
    | ToolChoiceFunctionParam
    | dict
    | None = None,
    stream: bool | None = None,
    temperature: float | None = None,
    top_p: float | None = None,
    max_output_tokens: int | None = None,
    reasoning: ReasoningParam | dict | None = None,
    text: ResponseTextConfigParam | dict | None = None,
    metadata: dict[str, str] | None = None,
    previous_response_id: str | None = None,
    include: list[str] | None = None,
    store: bool | None = None,
    truncation: Literal["auto", "disabled"] | None = None,
    parallel_tool_calls: bool | None = None,
    max_tool_calls: int | None = None,
    background: bool | None = None,
    conversation: str | ConversationParam | dict | None = None,
    prompt: ResponsePromptParam | dict | None = None,
    service_tier: Literal["auto", "default", "flex", "scale", "priority"] | None = None,
    stream_options: StreamOptionsParam | dict | None = None,
    top_logprobs: int | None = None,
    timeout: float | None = None,
    provider: LlmServiceProvider | LlmServiceProviderStr | None | _NotGiven = NOT_GIVEN,
    llm_api_key: str | None | _NotGiven = NOT_GIVEN,
    features: FeaturesHeader | None | _NotGiven = NOT_GIVEN,
    security_policy: SecurityPolicyHeader | None | _NotGiven = NOT_GIVEN,
    fine_grained_config: FineGrainedConfigHeader | None | _NotGiven = NOT_GIVEN,
    endpoint_type: str | _NotGiven = NOT_GIVEN,
    session_id: str | None | _NotGiven = NOT_GIVEN,
    feature_overrides: dict[str, Any] | None = None,
    policy_overrides: dict[str, Any] | None = None,
    config_overrides: dict[str, Any] | None = None,
    custom_headers: dict[str, str] | None = None,
) -> ResponsesResponse | SyncStream[OpenAiResponseStreamEvent]

Send a Responses API request through Sequrity's secure orchestrator.

Parameters:

  • model

    (str) –

    The LLM model identifier (e.g., "gpt-4o", "o3").

  • input

    (str | list | None, default: None ) –

    Text, image, or file inputs to the model.

  • instructions

    (str | None, default: None ) –

    A system (or developer) message.

  • tools

    (list[ToolParam | dict] | None, default: None ) –

    List of tools available to the model.

  • tool_choice

    (Literal['none', 'auto', 'required'] | ToolChoiceFunctionParam | dict | None, default: None ) –

    How the model should select which tool to use.

  • stream

    (bool | None, default: None ) –

    Whether to stream the response. When True, returns a :class:SyncStream of :class:OpenAiResponseStreamEvent objects.

  • temperature

    (float | None, default: None ) –

    Sampling temperature (0-2).

  • top_p

    (float | None, default: None ) –

    Nucleus sampling parameter.

  • max_output_tokens

    (int | None, default: None ) –

    Upper bound for generated tokens.

  • reasoning

    (ReasoningParam | dict | None, default: None ) –

    Configuration for reasoning models.

  • text

    (ResponseTextConfigParam | dict | None, default: None ) –

    Text response format configuration.

  • metadata

    (dict[str, str] | None, default: None ) –

    Key-value pairs attached to the response.

  • previous_response_id

    (str | None, default: None ) –

    ID of the previous response for multi-turn.

  • include

    (list[str] | None, default: None ) –

    Additional output data to include.

  • store

    (bool | None, default: None ) –

    Whether to store the response for later retrieval.

  • truncation

    (Literal['auto', 'disabled'] | None, default: None ) –

    Truncation strategy for the response.

  • parallel_tool_calls

    (bool | None, default: None ) –

    Whether to allow parallel tool execution.

  • max_tool_calls

    (int | None, default: None ) –

    Maximum number of calls to built-in tools.

  • background

    (bool | None, default: None ) –

    Whether to run the response in the background.

  • conversation

    (str | ConversationParam | dict | None, default: None ) –

    Conversation context.

  • prompt

    (ResponsePromptParam | dict | None, default: None ) –

    Prompt template reference.

  • service_tier

    (Literal['auto', 'default', 'flex', 'scale', 'priority'] | None, default: None ) –

    Processing tier for serving the request.

  • stream_options

    (StreamOptionsParam | dict | None, default: None ) –

    Options for streaming responses.

  • top_logprobs

    (int | None, default: None ) –

    Number of most likely tokens to return (0-20).

  • timeout

    (float | None, default: None ) –

    Client-side timeout in seconds.

  • provider

    (LlmServiceProvider | LlmServiceProviderStr | None | _NotGiven, default: NOT_GIVEN ) –

    LLM service provider override.

  • llm_api_key

    (str | None | _NotGiven, default: NOT_GIVEN ) –

    LLM provider API key override.

  • features

    (FeaturesHeader | None | _NotGiven, default: NOT_GIVEN ) –

    Security features override.

  • security_policy

    (SecurityPolicyHeader | None | _NotGiven, default: NOT_GIVEN ) –

    Security policy override.

  • fine_grained_config

    (FineGrainedConfigHeader | None | _NotGiven, default: NOT_GIVEN ) –

    Fine-grained config override.

  • endpoint_type

    (str | _NotGiven, default: NOT_GIVEN ) –

    Endpoint type override.

  • session_id

    (str | None | _NotGiven, default: NOT_GIVEN ) –

    Explicit session ID override.

  • feature_overrides

    (dict[str, Any] | None, default: None ) –

    Dict to deep-merge into the serialized X-Features header JSON. Allows adding or overriding fields without loosening Pydantic validation on :class:FeaturesHeader.

  • policy_overrides

    (dict[str, Any] | None, default: None ) –

    Dict to deep-merge into the serialized X-Policy header JSON.

  • config_overrides

    (dict[str, Any] | None, default: None ) –

    Dict to deep-merge into the serialized X-Config header JSON.

Returns:

  • ResponsesResponse | SyncStream[OpenAiResponseStreamEvent]

    ResponsesResponse when stream is False/None,

  • ResponsesResponse | SyncStream[OpenAiResponseStreamEvent]

    or SyncStream[OpenAiResponseStreamEvent] when stream is True.


Request Types

ResponsesRequest pydantic-model

OpenAI Responses API request. See https://platform.openai.com/docs/api-reference/responses.

Show JSON schema:
{
  "$defs": {
    "ApplyPatchCallOutputParam": {
      "description": "Output from an apply patch tool call.",
      "properties": {
        "call_id": {
          "description": "The tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "status": {
          "description": "The status.",
          "enum": [
            "completed",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        },
        "type": {
          "const": "apply_patch_call_output",
          "description": "Always 'apply_patch_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Log text.",
          "title": "Output"
        }
      },
      "required": [
        "call_id",
        "status",
        "type"
      ],
      "title": "ApplyPatchCallOutputParam",
      "type": "object"
    },
    "ApplyPatchCallParam": {
      "description": "An apply patch tool call.",
      "properties": {
        "call_id": {
          "description": "The tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "operation": {
          "additionalProperties": true,
          "description": "The file operation (create_file, delete_file, update_file).",
          "title": "Operation",
          "type": "object"
        },
        "status": {
          "description": "The status.",
          "enum": [
            "in_progress",
            "completed"
          ],
          "title": "Status",
          "type": "string"
        },
        "type": {
          "const": "apply_patch_call",
          "description": "Always 'apply_patch_call'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        }
      },
      "required": [
        "call_id",
        "operation",
        "status",
        "type"
      ],
      "title": "ApplyPatchCallParam",
      "type": "object"
    },
    "ApplyPatchToolParam": {
      "properties": {
        "type": {
          "const": "apply_patch",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ApplyPatchToolParam",
      "type": "object"
    },
    "CodeInterpreterContainerAuto": {
      "properties": {
        "type": {
          "const": "auto",
          "description": "Always 'auto'.",
          "title": "Type",
          "type": "string"
        },
        "file_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Uploaded files.",
          "title": "File Ids"
        },
        "memory_limit": {
          "anyOf": [
            {
              "enum": [
                "1g",
                "4g",
                "16g",
                "64g"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Memory limit.",
          "title": "Memory Limit"
        }
      },
      "required": [
        "type"
      ],
      "title": "CodeInterpreterContainerAuto",
      "type": "object"
    },
    "CodeInterpreterToolParam": {
      "properties": {
        "type": {
          "const": "code_interpreter",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        },
        "container": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/CodeInterpreterContainerAuto"
            }
          ],
          "description": "The code interpreter container.",
          "title": "Container"
        }
      },
      "required": [
        "type",
        "container"
      ],
      "title": "CodeInterpreterToolParam",
      "type": "object"
    },
    "ComputerCallOutputAcknowledgedSafetyCheck": {
      "properties": {
        "id": {
          "description": "The safety check ID.",
          "title": "Id",
          "type": "string"
        },
        "code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The type of the pending safety check.",
          "title": "Code"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Details about the pending safety check.",
          "title": "Message"
        }
      },
      "required": [
        "id"
      ],
      "title": "ComputerCallOutputAcknowledgedSafetyCheck",
      "type": "object"
    },
    "ComputerCallOutputParam": {
      "description": "Output from a computer tool call.",
      "properties": {
        "call_id": {
          "description": "The computer tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "output": {
          "additionalProperties": true,
          "description": "Screenshot output.",
          "title": "Output",
          "type": "object"
        },
        "type": {
          "const": "computer_call_output",
          "description": "Always 'computer_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "acknowledged_safety_checks": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ComputerCallOutputAcknowledgedSafetyCheck"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Acknowledged safety checks.",
          "title": "Acknowledged Safety Checks"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "call_id",
        "output",
        "type"
      ],
      "title": "ComputerCallOutputParam",
      "type": "object"
    },
    "ComputerToolParam": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "const": "computer_use_preview",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ComputerToolParam",
      "type": "object"
    },
    "ConversationParam": {
      "properties": {
        "id": {
          "description": "The unique ID of the conversation.",
          "title": "Id",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "title": "ConversationParam",
      "type": "object"
    },
    "CustomToolParam": {
      "description": "Custom tool with grammar-based input format.",
      "properties": {
        "type": {
          "const": "custom",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        },
        "name": {
          "description": "The custom tool name.",
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tool description.",
          "title": "Description"
        },
        "format": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input format specification.",
          "title": "Format"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "title": "CustomToolParam",
      "type": "object"
    },
    "FileSearchToolParam": {
      "properties": {
        "type": {
          "const": "file_search",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        },
        "file_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Files to search.",
          "title": "File Ids"
        }
      },
      "required": [
        "type"
      ],
      "title": "FileSearchToolParam",
      "type": "object"
    },
    "FunctionCallOutputParam": {
      "description": "The output of a function tool call.",
      "properties": {
        "call_id": {
          "description": "The unique ID of the function tool call generated by the model.",
          "title": "Call Id",
          "type": "string"
        },
        "output": {
          "description": "Text output of the function tool call.",
          "title": "Output",
          "type": "string"
        },
        "type": {
          "const": "function_call_output",
          "description": "The type of the function tool call output. Always 'function_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the function tool call output.",
          "title": "Id"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the item.",
          "title": "Status"
        }
      },
      "required": [
        "call_id",
        "output",
        "type"
      ],
      "title": "FunctionCallOutputParam",
      "type": "object"
    },
    "FunctionShellToolParam": {
      "properties": {
        "type": {
          "const": "function_shell",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "FunctionShellToolParam",
      "type": "object"
    },
    "FunctionToolParam": {
      "description": "Defines a function tool the model can call.\n\nNote: The Responses API uses a flat structure (name, parameters, strict, description\nat the top level), unlike the Chat Completions API which nests them under a\n``function`` key.",
      "properties": {
        "name": {
          "description": "The name of the function to call.",
          "title": "Name",
          "type": "string"
        },
        "parameters": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A JSON Schema object describing the parameters of the function.",
          "title": "Parameters"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to enforce strict parameter validation. Default true.",
          "title": "Strict"
        },
        "type": {
          "const": "function",
          "description": "The type of the function tool. Always 'function'.",
          "title": "Type",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A description of the function.",
          "title": "Description"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "title": "FunctionToolParam",
      "type": "object"
    },
    "ImageGenerationCallParam": {
      "description": "An image generation call for multi-turn conversations.",
      "properties": {
        "id": {
          "description": "The unique ID.",
          "title": "Id",
          "type": "string"
        },
        "result": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The generated image encoded in base64.",
          "title": "Result"
        },
        "status": {
          "description": "The status.",
          "enum": [
            "in_progress",
            "completed",
            "generating",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        },
        "type": {
          "const": "image_generation_call",
          "description": "Always 'image_generation_call'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "status",
        "type"
      ],
      "title": "ImageGenerationCallParam",
      "type": "object"
    },
    "ImageGenerationInputImageMask": {
      "properties": {
        "file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Mask image file ID.",
          "title": "File Id"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Base64-encoded mask.",
          "title": "Image Url"
        }
      },
      "title": "ImageGenerationInputImageMask",
      "type": "object"
    },
    "ImageGenerationToolParam": {
      "properties": {
        "type": {
          "const": "image_generation",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "enum": [
                "gpt-image-1",
                "gpt-image-1-mini"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The image generation model to use.",
          "title": "Model"
        },
        "size": {
          "anyOf": [
            {
              "enum": [
                "1024x1024",
                "1024x1536",
                "1536x1024",
                "auto"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The size of the generated image.",
          "title": "Size"
        },
        "quality": {
          "anyOf": [
            {
              "enum": [
                "low",
                "medium",
                "high",
                "auto"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The quality of the generated image.",
          "title": "Quality"
        },
        "background": {
          "anyOf": [
            {
              "enum": [
                "transparent",
                "opaque",
                "auto"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The background of the generated image.",
          "title": "Background"
        },
        "input_fidelity": {
          "anyOf": [
            {
              "enum": [
                "high",
                "low"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input fidelity.",
          "title": "Input Fidelity"
        },
        "input_image_mask": {
          "anyOf": [
            {
              "$ref": "#/$defs/ImageGenerationInputImageMask"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inpainting mask."
        },
        "moderation": {
          "anyOf": [
            {
              "enum": [
                "auto",
                "low"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Moderation level.",
          "title": "Moderation"
        },
        "output_compression": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Compression level.",
          "title": "Output Compression"
        },
        "output_format": {
          "anyOf": [
            {
              "enum": [
                "png",
                "webp",
                "jpeg"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output format.",
          "title": "Output Format"
        },
        "partial_images": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Partial images for streaming (0-3).",
          "title": "Partial Images"
        }
      },
      "required": [
        "type"
      ],
      "title": "ImageGenerationToolParam",
      "type": "object"
    },
    "InputAudioParam": {
      "properties": {
        "audio": {
          "description": "Base64-encoded audio data.",
          "title": "Audio",
          "type": "string"
        },
        "type": {
          "const": "input_audio",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "audio",
        "type"
      ],
      "title": "InputAudioParam",
      "type": "object"
    },
    "InputFileParam": {
      "properties": {
        "file_id": {
          "description": "The ID of the uploaded file.",
          "title": "File Id",
          "type": "string"
        },
        "type": {
          "const": "input_file",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "type"
      ],
      "title": "InputFileParam",
      "type": "object"
    },
    "InputImageParam": {
      "description": "An image input. Supports both URL and file_id references.",
      "properties": {
        "type": {
          "const": "input_image",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        },
        "detail": {
          "anyOf": [
            {
              "enum": [
                "auto",
                "low",
                "high"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The detail level of the image.",
          "title": "Detail"
        },
        "file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the uploaded file.",
          "title": "File Id"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The URL of the image or base64 data URL.",
          "title": "Image Url"
        }
      },
      "required": [
        "type"
      ],
      "title": "InputImageParam",
      "type": "object"
    },
    "InputMessageParam": {
      "properties": {
        "role": {
          "description": "The role of the message. One of 'user', 'system', or 'developer'.",
          "enum": [
            "user",
            "system",
            "developer"
          ],
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "discriminator": {
                  "mapping": {
                    "input_audio": "#/$defs/InputAudioParam",
                    "input_file": "#/$defs/InputFileParam",
                    "input_image": "#/$defs/InputImageParam",
                    "input_text": "#/$defs/InputTextParam"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/InputTextParam"
                  },
                  {
                    "$ref": "#/$defs/InputImageParam"
                  },
                  {
                    "$ref": "#/$defs/InputFileParam"
                  },
                  {
                    "$ref": "#/$defs/InputAudioParam"
                  }
                ]
              },
              "type": "array"
            }
          ],
          "description": "The content of the message. Can be a string or list of content items.",
          "title": "Content"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "InputMessageParam",
      "type": "object"
    },
    "InputTextParam": {
      "properties": {
        "text": {
          "description": "The text content.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "input_text",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "InputTextParam",
      "type": "object"
    },
    "ItemReferenceParam": {
      "description": "A reference to an existing item.",
      "properties": {
        "id": {
          "description": "The item ID.",
          "title": "Id",
          "type": "string"
        },
        "type": {
          "anyOf": [
            {
              "const": "item_reference",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Always 'item_reference'.",
          "title": "Type"
        }
      },
      "required": [
        "id"
      ],
      "title": "ItemReferenceParam",
      "type": "object"
    },
    "LocalShellCallActionParam": {
      "properties": {
        "command": {
          "description": "The command to run.",
          "items": {
            "type": "string"
          },
          "title": "Command",
          "type": "array"
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables.",
          "title": "Env",
          "type": "object"
        },
        "type": {
          "const": "exec",
          "description": "Always 'exec'.",
          "title": "Type",
          "type": "string"
        },
        "timeout_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional timeout in milliseconds.",
          "title": "Timeout Ms"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional user to run the command as.",
          "title": "User"
        },
        "working_directory": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional working directory.",
          "title": "Working Directory"
        }
      },
      "required": [
        "command",
        "type"
      ],
      "title": "LocalShellCallActionParam",
      "type": "object"
    },
    "LocalShellCallOutputParam": {
      "description": "Output from a local shell tool call.",
      "properties": {
        "id": {
          "description": "The tool call output ID.",
          "title": "Id",
          "type": "string"
        },
        "output": {
          "description": "JSON string of output.",
          "title": "Output",
          "type": "string"
        },
        "type": {
          "const": "local_shell_call_output",
          "description": "Always 'local_shell_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "id",
        "output",
        "type"
      ],
      "title": "LocalShellCallOutputParam",
      "type": "object"
    },
    "LocalShellCallParam": {
      "description": "A local shell tool call.",
      "properties": {
        "id": {
          "description": "The unique ID.",
          "title": "Id",
          "type": "string"
        },
        "action": {
          "$ref": "#/$defs/LocalShellCallActionParam",
          "description": "The shell command to execute."
        },
        "call_id": {
          "description": "The tool call ID from the model.",
          "title": "Call Id",
          "type": "string"
        },
        "status": {
          "description": "The status.",
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "title": "Status",
          "type": "string"
        },
        "type": {
          "const": "local_shell_call",
          "description": "Always 'local_shell_call'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "action",
        "call_id",
        "status",
        "type"
      ],
      "title": "LocalShellCallParam",
      "type": "object"
    },
    "LocalShellToolParam": {
      "properties": {
        "type": {
          "const": "local_shell",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "LocalShellToolParam",
      "type": "object"
    },
    "McpAllowedToolsFilter": {
      "properties": {
        "read_only": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tool is read-only.",
          "title": "Read Only"
        },
        "tool_names": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Allowed tool names.",
          "title": "Tool Names"
        }
      },
      "title": "McpAllowedToolsFilter",
      "type": "object"
    },
    "McpApprovalFilter": {
      "properties": {
        "always": {
          "anyOf": [
            {
              "$ref": "#/$defs/McpAllowedToolsFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Always require approval."
        },
        "never": {
          "anyOf": [
            {
              "$ref": "#/$defs/McpAllowedToolsFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Never require approval."
        }
      },
      "title": "McpApprovalFilter",
      "type": "object"
    },
    "McpApprovalRequestParam": {
      "description": "MCP tool approval request.",
      "properties": {
        "id": {
          "description": "The request ID.",
          "title": "Id",
          "type": "string"
        },
        "arguments": {
          "description": "JSON string of tool arguments.",
          "title": "Arguments",
          "type": "string"
        },
        "name": {
          "description": "The tool name.",
          "title": "Name",
          "type": "string"
        },
        "server_label": {
          "description": "The MCP server label.",
          "title": "Server Label",
          "type": "string"
        },
        "type": {
          "const": "mcp_approval_request",
          "description": "Always 'mcp_approval_request'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "arguments",
        "name",
        "server_label",
        "type"
      ],
      "title": "McpApprovalRequestParam",
      "type": "object"
    },
    "McpApprovalResponseParam": {
      "description": "MCP approval response.",
      "properties": {
        "approval_request_id": {
          "description": "The request ID being answered.",
          "title": "Approval Request Id",
          "type": "string"
        },
        "approve": {
          "description": "The approval decision.",
          "title": "Approve",
          "type": "boolean"
        },
        "type": {
          "const": "mcp_approval_response",
          "description": "Always 'mcp_approval_response'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The decision reason.",
          "title": "Reason"
        }
      },
      "required": [
        "approval_request_id",
        "approve",
        "type"
      ],
      "title": "McpApprovalResponseParam",
      "type": "object"
    },
    "McpCallParam": {
      "description": "MCP tool invocation.",
      "properties": {
        "id": {
          "description": "The tool call ID.",
          "title": "Id",
          "type": "string"
        },
        "arguments": {
          "description": "JSON string of arguments.",
          "title": "Arguments",
          "type": "string"
        },
        "name": {
          "description": "The tool name.",
          "title": "Name",
          "type": "string"
        },
        "server_label": {
          "description": "The MCP server label.",
          "title": "Server Label",
          "type": "string"
        },
        "type": {
          "const": "mcp_call",
          "description": "Always 'mcp_call'.",
          "title": "Type",
          "type": "string"
        },
        "approval_request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "For approval flow.",
          "title": "Approval Request Id"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tool error.",
          "title": "Error"
        },
        "output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tool output.",
          "title": "Output"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete",
                "calling",
                "failed"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "id",
        "arguments",
        "name",
        "server_label",
        "type"
      ],
      "title": "McpCallParam",
      "type": "object"
    },
    "McpListToolsParam": {
      "description": "MCP server tools list.",
      "properties": {
        "id": {
          "description": "The unique ID.",
          "title": "Id",
          "type": "string"
        },
        "server_label": {
          "description": "The MCP server label.",
          "title": "Server Label",
          "type": "string"
        },
        "tools": {
          "description": "Available tools.",
          "items": {
            "$ref": "#/$defs/McpListToolsToolParam"
          },
          "title": "Tools",
          "type": "array"
        },
        "type": {
          "const": "mcp_list_tools",
          "description": "Always 'mcp_list_tools'.",
          "title": "Type",
          "type": "string"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Error message.",
          "title": "Error"
        }
      },
      "required": [
        "id",
        "server_label",
        "tools",
        "type"
      ],
      "title": "McpListToolsParam",
      "type": "object"
    },
    "McpListToolsToolParam": {
      "properties": {
        "input_schema": {
          "additionalProperties": true,
          "description": "The JSON schema describing the tool's input.",
          "title": "Input Schema",
          "type": "object"
        },
        "name": {
          "description": "The name of the tool.",
          "title": "Name",
          "type": "string"
        },
        "annotations": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Additional annotations.",
          "title": "Annotations"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The description of the tool.",
          "title": "Description"
        }
      },
      "required": [
        "input_schema",
        "name"
      ],
      "title": "McpListToolsToolParam",
      "type": "object"
    },
    "McpToolParam": {
      "description": "MCP (Model Context Protocol) tool configuration.",
      "properties": {
        "type": {
          "const": "mcp",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        },
        "server_label": {
          "description": "Label for the MCP server.",
          "title": "Server Label",
          "type": "string"
        },
        "server_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL for the MCP server.",
          "title": "Server Url"
        },
        "connector_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Service connector ID.",
          "title": "Connector Id"
        },
        "allowed_tools": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "$ref": "#/$defs/McpAllowedToolsFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Allowed tools filter.",
          "title": "Allowed Tools"
        },
        "require_approval": {
          "anyOf": [
            {
              "enum": [
                "always",
                "never"
              ],
              "type": "string"
            },
            {
              "$ref": "#/$defs/McpApprovalFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Approval requirement.",
          "title": "Require Approval"
        },
        "authorization": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "OAuth access token.",
          "title": "Authorization"
        },
        "headers": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Custom HTTP headers.",
          "title": "Headers"
        },
        "server_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "MCP server description.",
          "title": "Server Description"
        }
      },
      "required": [
        "type",
        "server_label"
      ],
      "title": "McpToolParam",
      "type": "object"
    },
    "MessageParam": {
      "description": "A message input to the model with a role indicating instruction following hierarchy.",
      "properties": {
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "discriminator": {
                  "mapping": {
                    "input_audio": "#/$defs/InputAudioParam",
                    "input_file": "#/$defs/InputFileParam",
                    "input_image": "#/$defs/InputImageParam",
                    "input_text": "#/$defs/InputTextParam"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/InputTextParam"
                  },
                  {
                    "$ref": "#/$defs/InputImageParam"
                  },
                  {
                    "$ref": "#/$defs/InputFileParam"
                  },
                  {
                    "$ref": "#/$defs/InputAudioParam"
                  }
                ]
              },
              "type": "array"
            }
          ],
          "description": "A list of one or many input items to the model, containing different content types.",
          "title": "Content"
        },
        "role": {
          "description": "The role of the message input. One of 'user', 'system', or 'developer'.",
          "enum": [
            "user",
            "system",
            "developer"
          ],
          "title": "Role",
          "type": "string"
        },
        "type": {
          "const": "message",
          "description": "The type of the message input. Always 'message'.",
          "title": "Type",
          "type": "string"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the item.",
          "title": "Status"
        }
      },
      "required": [
        "content",
        "role",
        "type"
      ],
      "title": "MessageParam",
      "type": "object"
    },
    "OutputRefusalParam": {
      "description": "A refusal from the model.",
      "properties": {
        "refusal": {
          "description": "The refusal explanation from the model.",
          "title": "Refusal",
          "type": "string"
        },
        "type": {
          "const": "refusal",
          "description": "The type of the refusal. Always 'refusal'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "refusal",
        "type"
      ],
      "title": "OutputRefusalParam",
      "type": "object"
    },
    "OutputTextParam": {
      "description": "A text output from the model.",
      "properties": {
        "text": {
          "description": "The text output from the model.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "output_text",
          "description": "The type of the output text. Always 'output_text'.",
          "title": "Type",
          "type": "string"
        },
        "annotations": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Annotations for the text, such as citations.",
          "title": "Annotations"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "OutputTextParam",
      "type": "object"
    },
    "ReasoningItemParam": {
      "description": "A reasoning item for multi-turn conversations.",
      "properties": {
        "id": {
          "description": "The unique identifier.",
          "title": "Id",
          "type": "string"
        },
        "type": {
          "const": "reasoning",
          "description": "Always 'reasoning'.",
          "title": "Type",
          "type": "string"
        },
        "summary": {
          "description": "Reasoning summary.",
          "items": {
            "$ref": "#/$defs/ReasoningItemSummaryParam"
          },
          "title": "Summary",
          "type": "array"
        },
        "encrypted_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Encrypted content for multi-turn.",
          "title": "Encrypted Content"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "title": "ReasoningItemParam",
      "type": "object"
    },
    "ReasoningItemSummaryParam": {
      "properties": {
        "text": {
          "description": "A summary of the reasoning output.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "summary_text",
          "description": "Always 'summary_text'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ReasoningItemSummaryParam",
      "type": "object"
    },
    "ReasoningParam": {
      "properties": {
        "effort": {
          "anyOf": [
            {
              "enum": [
                "none",
                "low",
                "medium",
                "high",
                "xhigh"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The reasoning effort level.",
          "title": "Effort"
        },
        "generate_summary": {
          "anyOf": [
            {
              "enum": [
                "auto",
                "concise",
                "detailed"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to generate a summary of the reasoning.",
          "title": "Generate Summary"
        }
      },
      "title": "ReasoningParam",
      "type": "object"
    },
    "ResponseCustomToolCallOutputParam": {
      "description": "The output of a custom tool call from your code, being sent back to the model.",
      "properties": {
        "call_id": {
          "description": "The call ID, used to map this custom tool call output to a custom tool call.",
          "title": "Call Id",
          "type": "string"
        },
        "output": {
          "description": "The output from the custom tool call generated by your code.",
          "title": "Output",
          "type": "string"
        },
        "type": {
          "const": "custom_tool_call_output",
          "description": "The type of the custom tool call output. Always 'custom_tool_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the custom tool call output.",
          "title": "Id"
        }
      },
      "required": [
        "call_id",
        "output",
        "type"
      ],
      "title": "ResponseCustomToolCallOutputParam",
      "type": "object"
    },
    "ResponseCustomToolCallParam": {
      "description": "A call to a custom tool created by the model.",
      "properties": {
        "call_id": {
          "description": "An identifier used to map this custom tool call to a tool call output.",
          "title": "Call Id",
          "type": "string"
        },
        "input": {
          "description": "The input for the custom tool call generated by the model.",
          "title": "Input",
          "type": "string"
        },
        "name": {
          "description": "The name of the custom tool being called.",
          "title": "Name",
          "type": "string"
        },
        "type": {
          "const": "custom_tool_call",
          "description": "The type of the custom tool call. Always 'custom_tool_call'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the custom tool call.",
          "title": "Id"
        }
      },
      "required": [
        "call_id",
        "input",
        "name",
        "type"
      ],
      "title": "ResponseCustomToolCallParam",
      "type": "object"
    },
    "ResponseFunctionToolCallParam": {
      "description": "A tool call to run a function, used as input for multi-turn conversations.",
      "properties": {
        "arguments": {
          "description": "A JSON string of the arguments to pass to the function.",
          "title": "Arguments",
          "type": "string"
        },
        "call_id": {
          "description": "The unique ID of the function tool call generated by the model.",
          "title": "Call Id",
          "type": "string"
        },
        "name": {
          "description": "The name of the function to run.",
          "title": "Name",
          "type": "string"
        },
        "type": {
          "const": "function_call",
          "description": "The type of the function tool call. Always 'function_call'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the function tool call.",
          "title": "Id"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the item.",
          "title": "Status"
        }
      },
      "required": [
        "arguments",
        "call_id",
        "name",
        "type"
      ],
      "title": "ResponseFunctionToolCallParam",
      "type": "object"
    },
    "ResponseOutputMessageParam": {
      "description": "An output message from the model, used as input for multi-turn conversations.",
      "properties": {
        "id": {
          "description": "The unique ID of the output message.",
          "title": "Id",
          "type": "string"
        },
        "content": {
          "description": "The content of the output message.",
          "items": {
            "discriminator": {
              "mapping": {
                "output_text": "#/$defs/OutputTextParam",
                "refusal": "#/$defs/OutputRefusalParam"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/OutputTextParam"
              },
              {
                "$ref": "#/$defs/OutputRefusalParam"
              }
            ]
          },
          "title": "Content",
          "type": "array"
        },
        "role": {
          "const": "assistant",
          "description": "The role of the output message. Always 'assistant'.",
          "title": "Role",
          "type": "string"
        },
        "status": {
          "description": "The status of the message.",
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "title": "Status",
          "type": "string"
        },
        "type": {
          "const": "message",
          "description": "The type of the output message. Always 'message'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "content",
        "role",
        "status",
        "type"
      ],
      "title": "ResponseOutputMessageParam",
      "type": "object"
    },
    "ResponsePromptParam": {
      "properties": {
        "id": {
          "description": "The unique ID of the prompt template.",
          "title": "Id",
          "type": "string"
        },
        "variables": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Variables to substitute in the prompt template.",
          "title": "Variables"
        }
      },
      "required": [
        "id"
      ],
      "title": "ResponsePromptParam",
      "type": "object"
    },
    "ResponseTextConfigParam": {
      "properties": {
        "format": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "json_object": "#/$defs/TextConfigJSONObjectParam",
                  "json_schema": "#/$defs/TextConfigJSONSchemaParam",
                  "text": "#/$defs/TextConfigTextParam"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/TextConfigJSONSchemaParam"
                },
                {
                  "$ref": "#/$defs/TextConfigJSONObjectParam"
                },
                {
                  "$ref": "#/$defs/TextConfigTextParam"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The format of the text response.",
          "title": "Format"
        }
      },
      "title": "ResponseTextConfigParam",
      "type": "object"
    },
    "ShellCallActionParam": {
      "properties": {
        "commands": {
          "description": "Shell commands to run.",
          "items": {
            "type": "string"
          },
          "title": "Commands",
          "type": "array"
        },
        "max_output_length": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Max output characters.",
          "title": "Max Output Length"
        },
        "timeout_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Max wall-clock time in ms.",
          "title": "Timeout Ms"
        }
      },
      "required": [
        "commands"
      ],
      "title": "ShellCallActionParam",
      "type": "object"
    },
    "ShellCallOutputParam": {
      "description": "Output from a shell tool call.",
      "properties": {
        "call_id": {
          "description": "The shell tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "output": {
          "description": "Output chunks.",
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Output",
          "type": "array"
        },
        "type": {
          "const": "shell_call_output",
          "description": "Always 'shell_call_output'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "max_output_length": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Max output length.",
          "title": "Max Output Length"
        }
      },
      "required": [
        "call_id",
        "output",
        "type"
      ],
      "title": "ShellCallOutputParam",
      "type": "object"
    },
    "ShellCallParam": {
      "description": "A shell command request.",
      "properties": {
        "action": {
          "$ref": "#/$defs/ShellCallActionParam",
          "description": "The shell action."
        },
        "call_id": {
          "description": "The tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "type": {
          "const": "shell_call",
          "description": "Always 'shell_call'.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "action",
        "call_id",
        "type"
      ],
      "title": "ShellCallParam",
      "type": "object"
    },
    "StreamOptionsParam": {
      "properties": {
        "include_usage": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "If set, an additional chunk will be streamed with usage statistics.",
          "title": "Include Usage"
        }
      },
      "title": "StreamOptionsParam",
      "type": "object"
    },
    "TextConfigJSONObjectParam": {
      "properties": {
        "type": {
          "const": "json_object",
          "description": "JSON object output.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "TextConfigJSONObjectParam",
      "type": "object"
    },
    "TextConfigJSONSchemaParam": {
      "properties": {
        "type": {
          "const": "json_schema",
          "description": "Structured JSON output.",
          "title": "Type",
          "type": "string"
        },
        "name": {
          "description": "The name of the schema.",
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A description of the schema.",
          "title": "Description"
        },
        "schema": {
          "additionalProperties": true,
          "description": "The JSON schema.",
          "title": "Schema",
          "type": "object"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to enable strict schema adherence when generating the output.",
          "title": "Strict"
        }
      },
      "required": [
        "type",
        "name",
        "schema"
      ],
      "title": "TextConfigJSONSchemaParam",
      "type": "object"
    },
    "TextConfigTextParam": {
      "properties": {
        "type": {
          "const": "text",
          "description": "Plain text output.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "TextConfigTextParam",
      "type": "object"
    },
    "ToolChoiceFunctionParam": {
      "properties": {
        "type": {
          "const": "function",
          "description": "The model will use the specified function.",
          "title": "Type",
          "type": "string"
        },
        "name": {
          "description": "The name of the function to use.",
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "title": "ToolChoiceFunctionParam",
      "type": "object"
    },
    "WebSearchPreviewToolParam": {
      "properties": {
        "type": {
          "description": "The type of the tool.",
          "enum": [
            "web_search_preview",
            "web_search_preview_2025_03_11"
          ],
          "title": "Type",
          "type": "string"
        },
        "search_context_size": {
          "anyOf": [
            {
              "enum": [
                "low",
                "medium",
                "high"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Search context size.",
          "title": "Search Context Size"
        },
        "user_location": {
          "anyOf": [
            {
              "$ref": "#/$defs/WebSearchPreviewUserLocation"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "User location."
        }
      },
      "required": [
        "type"
      ],
      "title": "WebSearchPreviewToolParam",
      "type": "object"
    },
    "WebSearchPreviewUserLocation": {
      "properties": {
        "type": {
          "const": "approximate",
          "description": "Always 'approximate'.",
          "title": "Type",
          "type": "string"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "City name.",
          "title": "City"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO country code.",
          "title": "Country"
        },
        "region": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Region name.",
          "title": "Region"
        },
        "timezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IANA timezone.",
          "title": "Timezone"
        }
      },
      "required": [
        "type"
      ],
      "title": "WebSearchPreviewUserLocation",
      "type": "object"
    },
    "WebSearchToolParam": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "const": "web_search",
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "WebSearchToolParam",
      "type": "object"
    }
  },
  "description": "OpenAI Responses API request. See https://platform.openai.com/docs/api-reference/responses.",
  "properties": {
    "model": {
      "description": "Model ID used to generate the response, like 'gpt-4o' or 'o3'.",
      "title": "Model",
      "type": "string"
    },
    "background": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to run the model response in the background.",
      "title": "Background"
    },
    "conversation": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/ConversationParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The conversation that this response belongs to.",
      "title": "Conversation"
    },
    "include": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Specify additional output data to include in the model response.",
      "title": "Include"
    },
    "input": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/InputMessageParam"
              },
              {
                "$ref": "#/$defs/MessageParam"
              },
              {
                "$ref": "#/$defs/ResponseOutputMessageParam"
              },
              {
                "$ref": "#/$defs/ResponseFunctionToolCallParam"
              },
              {
                "$ref": "#/$defs/FunctionCallOutputParam"
              },
              {
                "$ref": "#/$defs/ResponseCustomToolCallParam"
              },
              {
                "$ref": "#/$defs/ResponseCustomToolCallOutputParam"
              },
              {
                "$ref": "#/$defs/ComputerCallOutputParam"
              },
              {
                "$ref": "#/$defs/LocalShellCallParam"
              },
              {
                "$ref": "#/$defs/LocalShellCallOutputParam"
              },
              {
                "$ref": "#/$defs/ShellCallParam"
              },
              {
                "$ref": "#/$defs/ShellCallOutputParam"
              },
              {
                "$ref": "#/$defs/ApplyPatchCallParam"
              },
              {
                "$ref": "#/$defs/ApplyPatchCallOutputParam"
              },
              {
                "$ref": "#/$defs/McpListToolsParam"
              },
              {
                "$ref": "#/$defs/McpApprovalRequestParam"
              },
              {
                "$ref": "#/$defs/McpApprovalResponseParam"
              },
              {
                "$ref": "#/$defs/McpCallParam"
              },
              {
                "$ref": "#/$defs/ReasoningItemParam"
              },
              {
                "$ref": "#/$defs/ImageGenerationCallParam"
              },
              {
                "$ref": "#/$defs/ItemReferenceParam"
              },
              {
                "additionalProperties": true,
                "type": "object"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text, image, or file inputs to the model, used to generate a response.",
      "title": "Input"
    },
    "instructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A system (or developer) message inserted into the model's context.",
      "title": "Instructions"
    },
    "max_output_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "An upper bound for the number of tokens that can be generated for a response.",
      "title": "Max Output Tokens"
    },
    "max_tool_calls": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The maximum number of total calls to built-in tools.",
      "title": "Max Tool Calls"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Set of 16 key-value pairs that can be attached to an object.",
      "title": "Metadata"
    },
    "parallel_tool_calls": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to allow the model to run tool calls in parallel.",
      "title": "Parallel Tool Calls"
    },
    "previous_response_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the previous response to the model.",
      "title": "Previous Response Id"
    },
    "prompt": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponsePromptParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reference to a prompt template and its variables."
    },
    "prompt_cache_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Used by OpenAI to cache responses for similar requests.",
      "title": "Prompt Cache Key"
    },
    "prompt_cache_retention": {
      "anyOf": [
        {
          "enum": [
            "in-memory",
            "24h"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Retention policy for prompt cache.",
      "title": "Prompt Cache Retention"
    },
    "reasoning": {
      "anyOf": [
        {
          "$ref": "#/$defs/ReasoningParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Configuration options for reasoning models."
    },
    "safety_identifier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A stable identifier used to help detect users violating usage policies.",
      "title": "Safety Identifier"
    },
    "service_tier": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "default",
            "flex",
            "scale",
            "priority"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Specifies the processing type used for serving the request.",
      "title": "Service Tier"
    },
    "store": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to store the generated model response for later retrieval via API.",
      "title": "Store"
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If set to true, the model response data will be streamed.",
      "title": "Stream"
    },
    "stream_options": {
      "anyOf": [
        {
          "$ref": "#/$defs/StreamOptionsParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Options for streaming responses."
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Sampling temperature (0-2). Higher values make output more random.",
      "title": "Temperature"
    },
    "text": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponseTextConfigParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Configuration options for a text response from the model."
    },
    "tool_choice": {
      "anyOf": [
        {
          "enum": [
            "none",
            "auto",
            "required"
          ],
          "type": "string"
        },
        {
          "$ref": "#/$defs/ToolChoiceFunctionParam"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "How the model should select which tool to use.",
      "title": "Tool Choice"
    },
    "tools": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/FunctionToolParam"
              },
              {
                "$ref": "#/$defs/FileSearchToolParam"
              },
              {
                "$ref": "#/$defs/WebSearchToolParam"
              },
              {
                "$ref": "#/$defs/WebSearchPreviewToolParam"
              },
              {
                "$ref": "#/$defs/CodeInterpreterToolParam"
              },
              {
                "$ref": "#/$defs/ComputerToolParam"
              },
              {
                "$ref": "#/$defs/ImageGenerationToolParam"
              },
              {
                "$ref": "#/$defs/McpToolParam"
              },
              {
                "$ref": "#/$defs/LocalShellToolParam"
              },
              {
                "$ref": "#/$defs/FunctionShellToolParam"
              },
              {
                "$ref": "#/$defs/CustomToolParam"
              },
              {
                "$ref": "#/$defs/ApplyPatchToolParam"
              },
              {
                "additionalProperties": true,
                "type": "object"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "An array of tools the model may call while generating a response.",
      "title": "Tools"
    },
    "top_logprobs": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of most likely tokens to return at each position (0-20).",
      "title": "Top Logprobs"
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Nucleus sampling parameter.",
      "title": "Top P"
    },
    "truncation": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "disabled"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The truncation strategy to use for the model response.",
      "title": "Truncation"
    },
    "user": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Deprecated: use safety_identifier and prompt_cache_key.",
      "title": "User"
    },
    "timeout": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Client-side timeout in seconds.",
      "title": "Timeout"
    }
  },
  "required": [
    "model"
  ],
  "title": "ResponsesRequest",
  "type": "object"
}

Config:

  • extra: ignore

Fields:

model pydantic-field

model: str

Model ID used to generate the response, like 'gpt-4o' or 'o3'.

background pydantic-field

background: bool | None = None

Whether to run the model response in the background.

conversation pydantic-field

conversation: str | ConversationParam | None = None

The conversation that this response belongs to.

include pydantic-field

include: list[str] | None = None

Specify additional output data to include in the model response.

input pydantic-field

input: ResponseInputParam | None = None

Text, image, or file inputs to the model, used to generate a response.

instructions pydantic-field

instructions: str | None = None

A system (or developer) message inserted into the model's context.

max_output_tokens pydantic-field

max_output_tokens: int | None = None

An upper bound for the number of tokens that can be generated for a response.

max_tool_calls pydantic-field

max_tool_calls: int | None = None

The maximum number of total calls to built-in tools.

metadata pydantic-field

metadata: dict[str, str] | None = None

Set of 16 key-value pairs that can be attached to an object.

parallel_tool_calls pydantic-field

parallel_tool_calls: bool | None = None

Whether to allow the model to run tool calls in parallel.

previous_response_id pydantic-field

previous_response_id: str | None = None

The unique ID of the previous response to the model.

prompt pydantic-field

prompt: ResponsePromptParam | None = None

Reference to a prompt template and its variables.

prompt_cache_key pydantic-field

prompt_cache_key: str | None = None

Used by OpenAI to cache responses for similar requests.

prompt_cache_retention pydantic-field

prompt_cache_retention: Literal['in-memory', '24h'] | None = None

Retention policy for prompt cache.

reasoning pydantic-field

reasoning: ReasoningParam | None = None

Configuration options for reasoning models.

safety_identifier pydantic-field

safety_identifier: str | None = None

A stable identifier used to help detect users violating usage policies.

service_tier pydantic-field

service_tier: Literal['auto', 'default', 'flex', 'scale', 'priority'] | None = None

Specifies the processing type used for serving the request.

store pydantic-field

store: bool | None = None

Whether to store the generated model response for later retrieval via API.

stream pydantic-field

stream: bool | None = None

If set to true, the model response data will be streamed.

stream_options pydantic-field

stream_options: StreamOptionsParam | None = None

Options for streaming responses.

temperature pydantic-field

temperature: float | None = None

Sampling temperature (0-2). Higher values make output more random.

text pydantic-field

text: ResponseTextConfigParam | None = None

Configuration options for a text response from the model.

tool_choice pydantic-field

tool_choice: Literal["none", "auto", "required"] | ToolChoiceFunctionParam | None = None

How the model should select which tool to use.

tools pydantic-field

tools: list[ToolParam] | None = None

An array of tools the model may call while generating a response.

top_logprobs pydantic-field

top_logprobs: int | None = None

Number of most likely tokens to return at each position (0-20).

top_p pydantic-field

top_p: float | None = None

Nucleus sampling parameter.

truncation pydantic-field

truncation: Literal['auto', 'disabled'] | None = None

The truncation strategy to use for the model response.

user pydantic-field

user: str | None = None

Deprecated: use safety_identifier and prompt_cache_key.

timeout pydantic-field

timeout: float | None = None

Client-side timeout in seconds.

Input Types

InputMessageParam pydantic-model

Show JSON schema:
{
  "$defs": {
    "InputAudioParam": {
      "properties": {
        "audio": {
          "description": "Base64-encoded audio data.",
          "title": "Audio",
          "type": "string"
        },
        "type": {
          "const": "input_audio",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "audio",
        "type"
      ],
      "title": "InputAudioParam",
      "type": "object"
    },
    "InputFileParam": {
      "properties": {
        "file_id": {
          "description": "The ID of the uploaded file.",
          "title": "File Id",
          "type": "string"
        },
        "type": {
          "const": "input_file",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "type"
      ],
      "title": "InputFileParam",
      "type": "object"
    },
    "InputImageParam": {
      "description": "An image input. Supports both URL and file_id references.",
      "properties": {
        "type": {
          "const": "input_image",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        },
        "detail": {
          "anyOf": [
            {
              "enum": [
                "auto",
                "low",
                "high"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The detail level of the image.",
          "title": "Detail"
        },
        "file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the uploaded file.",
          "title": "File Id"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The URL of the image or base64 data URL.",
          "title": "Image Url"
        }
      },
      "required": [
        "type"
      ],
      "title": "InputImageParam",
      "type": "object"
    },
    "InputTextParam": {
      "properties": {
        "text": {
          "description": "The text content.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "input_text",
          "description": "The type of the input content.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "InputTextParam",
      "type": "object"
    }
  },
  "properties": {
    "role": {
      "description": "The role of the message. One of 'user', 'system', or 'developer'.",
      "enum": [
        "user",
        "system",
        "developer"
      ],
      "title": "Role",
      "type": "string"
    },
    "content": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "discriminator": {
              "mapping": {
                "input_audio": "#/$defs/InputAudioParam",
                "input_file": "#/$defs/InputFileParam",
                "input_image": "#/$defs/InputImageParam",
                "input_text": "#/$defs/InputTextParam"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/InputTextParam"
              },
              {
                "$ref": "#/$defs/InputImageParam"
              },
              {
                "$ref": "#/$defs/InputFileParam"
              },
              {
                "$ref": "#/$defs/InputAudioParam"
              }
            ]
          },
          "type": "array"
        }
      ],
      "description": "The content of the message. Can be a string or list of content items.",
      "title": "Content"
    }
  },
  "required": [
    "role",
    "content"
  ],
  "title": "InputMessageParam",
  "type": "object"
}

Fields:

role pydantic-field

role: Literal['user', 'system', 'developer']

The role of the message. One of 'user', 'system', or 'developer'.

content pydantic-field

content: str | list[InputContentParam]

The content of the message. Can be a string or list of content items.

InputTextParam pydantic-model

Show JSON schema:
{
  "properties": {
    "text": {
      "description": "The text content.",
      "title": "Text",
      "type": "string"
    },
    "type": {
      "const": "input_text",
      "description": "The type of the input content.",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "text",
    "type"
  ],
  "title": "InputTextParam",
  "type": "object"
}

Fields:

text pydantic-field

text: str

The text content.

type pydantic-field

type: Literal['input_text']

The type of the input content.

InputImageParam pydantic-model

An image input. Supports both URL and file_id references.

Show JSON schema:
{
  "description": "An image input. Supports both URL and file_id references.",
  "properties": {
    "type": {
      "const": "input_image",
      "description": "The type of the input content.",
      "title": "Type",
      "type": "string"
    },
    "detail": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "low",
            "high"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The detail level of the image.",
      "title": "Detail"
    },
    "file_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the uploaded file.",
      "title": "File Id"
    },
    "image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The URL of the image or base64 data URL.",
      "title": "Image Url"
    }
  },
  "required": [
    "type"
  ],
  "title": "InputImageParam",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['input_image']

The type of the input content.

detail pydantic-field

detail: Literal['auto', 'low', 'high'] | None = None

The detail level of the image.

file_id pydantic-field

file_id: str | None = None

The ID of the uploaded file.

image_url pydantic-field

image_url: str | None = None

The URL of the image or base64 data URL.

InputFileParam pydantic-model

Show JSON schema:
{
  "properties": {
    "file_id": {
      "description": "The ID of the uploaded file.",
      "title": "File Id",
      "type": "string"
    },
    "type": {
      "const": "input_file",
      "description": "The type of the input content.",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "file_id",
    "type"
  ],
  "title": "InputFileParam",
  "type": "object"
}

Fields:

file_id pydantic-field

file_id: str

The ID of the uploaded file.

type pydantic-field

type: Literal['input_file']

The type of the input content.

InputAudioParam pydantic-model

Show JSON schema:
{
  "properties": {
    "audio": {
      "description": "Base64-encoded audio data.",
      "title": "Audio",
      "type": "string"
    },
    "type": {
      "const": "input_audio",
      "description": "The type of the input content.",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "audio",
    "type"
  ],
  "title": "InputAudioParam",
  "type": "object"
}

Fields:

audio pydantic-field

audio: str

Base64-encoded audio data.

type pydantic-field

type: Literal['input_audio']

The type of the input content.

Multi-turn Input Types

FunctionCallOutputParam pydantic-model

The output of a function tool call.

Show JSON schema:
{
  "description": "The output of a function tool call.",
  "properties": {
    "call_id": {
      "description": "The unique ID of the function tool call generated by the model.",
      "title": "Call Id",
      "type": "string"
    },
    "output": {
      "description": "Text output of the function tool call.",
      "title": "Output",
      "type": "string"
    },
    "type": {
      "const": "function_call_output",
      "description": "The type of the function tool call output. Always 'function_call_output'.",
      "title": "Type",
      "type": "string"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the function tool call output.",
      "title": "Id"
    },
    "status": {
      "anyOf": [
        {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the item.",
      "title": "Status"
    }
  },
  "required": [
    "call_id",
    "output",
    "type"
  ],
  "title": "FunctionCallOutputParam",
  "type": "object"
}

Fields:

call_id pydantic-field

call_id: str

The unique ID of the function tool call generated by the model.

output pydantic-field

output: str

Text output of the function tool call.

type pydantic-field

type: Literal['function_call_output']

The type of the function tool call output. Always 'function_call_output'.

id pydantic-field

id: str | None = None

The unique ID of the function tool call output.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete'] | None = None

The status of the item.

ResponseOutputMessageParam pydantic-model

An output message from the model, used as input for multi-turn conversations.

Show JSON schema:
{
  "$defs": {
    "OutputRefusalParam": {
      "description": "A refusal from the model.",
      "properties": {
        "refusal": {
          "description": "The refusal explanation from the model.",
          "title": "Refusal",
          "type": "string"
        },
        "type": {
          "const": "refusal",
          "description": "The type of the refusal. Always 'refusal'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "refusal",
        "type"
      ],
      "title": "OutputRefusalParam",
      "type": "object"
    },
    "OutputTextParam": {
      "description": "A text output from the model.",
      "properties": {
        "text": {
          "description": "The text output from the model.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "output_text",
          "description": "The type of the output text. Always 'output_text'.",
          "title": "Type",
          "type": "string"
        },
        "annotations": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Annotations for the text, such as citations.",
          "title": "Annotations"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "OutputTextParam",
      "type": "object"
    }
  },
  "description": "An output message from the model, used as input for multi-turn conversations.",
  "properties": {
    "id": {
      "description": "The unique ID of the output message.",
      "title": "Id",
      "type": "string"
    },
    "content": {
      "description": "The content of the output message.",
      "items": {
        "discriminator": {
          "mapping": {
            "output_text": "#/$defs/OutputTextParam",
            "refusal": "#/$defs/OutputRefusalParam"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/OutputTextParam"
          },
          {
            "$ref": "#/$defs/OutputRefusalParam"
          }
        ]
      },
      "title": "Content",
      "type": "array"
    },
    "role": {
      "const": "assistant",
      "description": "The role of the output message. Always 'assistant'.",
      "title": "Role",
      "type": "string"
    },
    "status": {
      "description": "The status of the message.",
      "enum": [
        "in_progress",
        "completed",
        "incomplete"
      ],
      "title": "Status",
      "type": "string"
    },
    "type": {
      "const": "message",
      "description": "The type of the output message. Always 'message'.",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "id",
    "content",
    "role",
    "status",
    "type"
  ],
  "title": "ResponseOutputMessageParam",
  "type": "object"
}

Fields:

id pydantic-field

id: str

The unique ID of the output message.

content pydantic-field

content: list[OutputMessageContentParam]

The content of the output message.

role pydantic-field

role: Literal['assistant']

The role of the output message. Always 'assistant'.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete']

The status of the message.

type pydantic-field

type: Literal['message']

The type of the output message. Always 'message'.

ResponseFunctionToolCallParam pydantic-model

A tool call to run a function, used as input for multi-turn conversations.

Show JSON schema:
{
  "description": "A tool call to run a function, used as input for multi-turn conversations.",
  "properties": {
    "arguments": {
      "description": "A JSON string of the arguments to pass to the function.",
      "title": "Arguments",
      "type": "string"
    },
    "call_id": {
      "description": "The unique ID of the function tool call generated by the model.",
      "title": "Call Id",
      "type": "string"
    },
    "name": {
      "description": "The name of the function to run.",
      "title": "Name",
      "type": "string"
    },
    "type": {
      "const": "function_call",
      "description": "The type of the function tool call. Always 'function_call'.",
      "title": "Type",
      "type": "string"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the function tool call.",
      "title": "Id"
    },
    "status": {
      "anyOf": [
        {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the item.",
      "title": "Status"
    }
  },
  "required": [
    "arguments",
    "call_id",
    "name",
    "type"
  ],
  "title": "ResponseFunctionToolCallParam",
  "type": "object"
}

Fields:

arguments pydantic-field

arguments: str

A JSON string of the arguments to pass to the function.

call_id pydantic-field

call_id: str

The unique ID of the function tool call generated by the model.

name pydantic-field

name: str

The name of the function to run.

type pydantic-field

type: Literal['function_call']

The type of the function tool call. Always 'function_call'.

id pydantic-field

id: str | None = None

The unique ID of the function tool call.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete'] | None = None

The status of the item.

Tool Definitions

FunctionToolParam pydantic-model

Defines a function tool the model can call.

Note: The Responses API uses a flat structure (name, parameters, strict, description at the top level), unlike the Chat Completions API which nests them under a function key.

Show JSON schema:
{
  "description": "Defines a function tool the model can call.\n\nNote: The Responses API uses a flat structure (name, parameters, strict, description\nat the top level), unlike the Chat Completions API which nests them under a\n``function`` key.",
  "properties": {
    "name": {
      "description": "The name of the function to call.",
      "title": "Name",
      "type": "string"
    },
    "parameters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A JSON Schema object describing the parameters of the function.",
      "title": "Parameters"
    },
    "strict": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to enforce strict parameter validation. Default true.",
      "title": "Strict"
    },
    "type": {
      "const": "function",
      "description": "The type of the function tool. Always 'function'.",
      "title": "Type",
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A description of the function.",
      "title": "Description"
    }
  },
  "required": [
    "name",
    "type"
  ],
  "title": "FunctionToolParam",
  "type": "object"
}

Fields:

name pydantic-field

name: str

The name of the function to call.

parameters pydantic-field

parameters: dict[str, Any] | None = None

A JSON Schema object describing the parameters of the function.

strict pydantic-field

strict: bool | None = None

Whether to enforce strict parameter validation. Default true.

type pydantic-field

type: Literal['function']

The type of the function tool. Always 'function'.

description pydantic-field

description: str | None = None

A description of the function.

WebSearchPreviewToolParam pydantic-model

Show JSON schema:
{
  "$defs": {
    "WebSearchPreviewUserLocation": {
      "properties": {
        "type": {
          "const": "approximate",
          "description": "Always 'approximate'.",
          "title": "Type",
          "type": "string"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "City name.",
          "title": "City"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO country code.",
          "title": "Country"
        },
        "region": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Region name.",
          "title": "Region"
        },
        "timezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IANA timezone.",
          "title": "Timezone"
        }
      },
      "required": [
        "type"
      ],
      "title": "WebSearchPreviewUserLocation",
      "type": "object"
    }
  },
  "properties": {
    "type": {
      "description": "The type of the tool.",
      "enum": [
        "web_search_preview",
        "web_search_preview_2025_03_11"
      ],
      "title": "Type",
      "type": "string"
    },
    "search_context_size": {
      "anyOf": [
        {
          "enum": [
            "low",
            "medium",
            "high"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Search context size.",
      "title": "Search Context Size"
    },
    "user_location": {
      "anyOf": [
        {
          "$ref": "#/$defs/WebSearchPreviewUserLocation"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "User location."
    }
  },
  "required": [
    "type"
  ],
  "title": "WebSearchPreviewToolParam",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['web_search_preview', 'web_search_preview_2025_03_11']

The type of the tool.

search_context_size pydantic-field

search_context_size: Literal['low', 'medium', 'high'] | None = None

Search context size.

user_location pydantic-field

user_location: WebSearchPreviewUserLocation | None = None

User location.

CodeInterpreterToolParam pydantic-model

Show JSON schema:
{
  "$defs": {
    "CodeInterpreterContainerAuto": {
      "properties": {
        "type": {
          "const": "auto",
          "description": "Always 'auto'.",
          "title": "Type",
          "type": "string"
        },
        "file_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Uploaded files.",
          "title": "File Ids"
        },
        "memory_limit": {
          "anyOf": [
            {
              "enum": [
                "1g",
                "4g",
                "16g",
                "64g"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Memory limit.",
          "title": "Memory Limit"
        }
      },
      "required": [
        "type"
      ],
      "title": "CodeInterpreterContainerAuto",
      "type": "object"
    }
  },
  "properties": {
    "type": {
      "const": "code_interpreter",
      "description": "The type of the tool.",
      "title": "Type",
      "type": "string"
    },
    "container": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/CodeInterpreterContainerAuto"
        }
      ],
      "description": "The code interpreter container.",
      "title": "Container"
    }
  },
  "required": [
    "type",
    "container"
  ],
  "title": "CodeInterpreterToolParam",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['code_interpreter']

The type of the tool.

container pydantic-field

container: str | CodeInterpreterContainerAuto

The code interpreter container.

McpToolParam pydantic-model

MCP (Model Context Protocol) tool configuration.

Show JSON schema:
{
  "$defs": {
    "McpAllowedToolsFilter": {
      "properties": {
        "read_only": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tool is read-only.",
          "title": "Read Only"
        },
        "tool_names": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Allowed tool names.",
          "title": "Tool Names"
        }
      },
      "title": "McpAllowedToolsFilter",
      "type": "object"
    },
    "McpApprovalFilter": {
      "properties": {
        "always": {
          "anyOf": [
            {
              "$ref": "#/$defs/McpAllowedToolsFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Always require approval."
        },
        "never": {
          "anyOf": [
            {
              "$ref": "#/$defs/McpAllowedToolsFilter"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Never require approval."
        }
      },
      "title": "McpApprovalFilter",
      "type": "object"
    }
  },
  "description": "MCP (Model Context Protocol) tool configuration.",
  "properties": {
    "type": {
      "const": "mcp",
      "description": "The type of the tool.",
      "title": "Type",
      "type": "string"
    },
    "server_label": {
      "description": "Label for the MCP server.",
      "title": "Server Label",
      "type": "string"
    },
    "server_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL for the MCP server.",
      "title": "Server Url"
    },
    "connector_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Service connector ID.",
      "title": "Connector Id"
    },
    "allowed_tools": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "$ref": "#/$defs/McpAllowedToolsFilter"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Allowed tools filter.",
      "title": "Allowed Tools"
    },
    "require_approval": {
      "anyOf": [
        {
          "enum": [
            "always",
            "never"
          ],
          "type": "string"
        },
        {
          "$ref": "#/$defs/McpApprovalFilter"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Approval requirement.",
      "title": "Require Approval"
    },
    "authorization": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "OAuth access token.",
      "title": "Authorization"
    },
    "headers": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Custom HTTP headers.",
      "title": "Headers"
    },
    "server_description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "MCP server description.",
      "title": "Server Description"
    }
  },
  "required": [
    "type",
    "server_label"
  ],
  "title": "McpToolParam",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['mcp']

The type of the tool.

server_label pydantic-field

server_label: str

Label for the MCP server.

server_url pydantic-field

server_url: str | None = None

URL for the MCP server.

connector_id pydantic-field

connector_id: str | None = None

Service connector ID.

allowed_tools pydantic-field

allowed_tools: list[str] | McpAllowedToolsFilter | None = None

Allowed tools filter.

require_approval pydantic-field

require_approval: Literal['always', 'never'] | McpApprovalFilter | None = None

Approval requirement.

authorization pydantic-field

authorization: str | None = None

OAuth access token.

headers pydantic-field

headers: dict[str, str] | None = None

Custom HTTP headers.

server_description pydantic-field

server_description: str | None = None

MCP server description.

Tool Choice

ToolChoiceFunctionParam pydantic-model

Show JSON schema:
{
  "properties": {
    "type": {
      "const": "function",
      "description": "The model will use the specified function.",
      "title": "Type",
      "type": "string"
    },
    "name": {
      "description": "The name of the function to use.",
      "title": "Name",
      "type": "string"
    }
  },
  "required": [
    "type",
    "name"
  ],
  "title": "ToolChoiceFunctionParam",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['function']

The model will use the specified function.

name pydantic-field

name: str

The name of the function to use.

Text Config

ResponseTextConfigParam pydantic-model

Show JSON schema:
{
  "$defs": {
    "TextConfigJSONObjectParam": {
      "properties": {
        "type": {
          "const": "json_object",
          "description": "JSON object output.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "TextConfigJSONObjectParam",
      "type": "object"
    },
    "TextConfigJSONSchemaParam": {
      "properties": {
        "type": {
          "const": "json_schema",
          "description": "Structured JSON output.",
          "title": "Type",
          "type": "string"
        },
        "name": {
          "description": "The name of the schema.",
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A description of the schema.",
          "title": "Description"
        },
        "schema": {
          "additionalProperties": true,
          "description": "The JSON schema.",
          "title": "Schema",
          "type": "object"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to enable strict schema adherence when generating the output.",
          "title": "Strict"
        }
      },
      "required": [
        "type",
        "name",
        "schema"
      ],
      "title": "TextConfigJSONSchemaParam",
      "type": "object"
    },
    "TextConfigTextParam": {
      "properties": {
        "type": {
          "const": "text",
          "description": "Plain text output.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "TextConfigTextParam",
      "type": "object"
    }
  },
  "properties": {
    "format": {
      "anyOf": [
        {
          "discriminator": {
            "mapping": {
              "json_object": "#/$defs/TextConfigJSONObjectParam",
              "json_schema": "#/$defs/TextConfigJSONSchemaParam",
              "text": "#/$defs/TextConfigTextParam"
            },
            "propertyName": "type"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/TextConfigJSONSchemaParam"
            },
            {
              "$ref": "#/$defs/TextConfigJSONObjectParam"
            },
            {
              "$ref": "#/$defs/TextConfigTextParam"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The format of the text response.",
      "title": "Format"
    }
  },
  "title": "ResponseTextConfigParam",
  "type": "object"
}

Fields:

  • format (TextFormatParam | None)

format pydantic-field

format: TextFormatParam | None = None

The format of the text response.

Reasoning Config

ReasoningParam pydantic-model

Show JSON schema:
{
  "properties": {
    "effort": {
      "anyOf": [
        {
          "enum": [
            "none",
            "low",
            "medium",
            "high",
            "xhigh"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The reasoning effort level.",
      "title": "Effort"
    },
    "generate_summary": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "concise",
            "detailed"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to generate a summary of the reasoning.",
      "title": "Generate Summary"
    }
  },
  "title": "ReasoningParam",
  "type": "object"
}

Fields:

effort pydantic-field

effort: Literal['none', 'low', 'medium', 'high', 'xhigh'] | None = None

The reasoning effort level.

generate_summary pydantic-field

generate_summary: Literal['auto', 'concise', 'detailed'] | None = None

Whether to generate a summary of the reasoning.

Other Config Types

ConversationParam pydantic-model

Show JSON schema:
{
  "properties": {
    "id": {
      "description": "The unique ID of the conversation.",
      "title": "Id",
      "type": "string"
    }
  },
  "required": [
    "id"
  ],
  "title": "ConversationParam",
  "type": "object"
}

Fields:

id pydantic-field

id: str

The unique ID of the conversation.

ResponsePromptParam pydantic-model

Show JSON schema:
{
  "properties": {
    "id": {
      "description": "The unique ID of the prompt template.",
      "title": "Id",
      "type": "string"
    },
    "variables": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Variables to substitute in the prompt template.",
      "title": "Variables"
    }
  },
  "required": [
    "id"
  ],
  "title": "ResponsePromptParam",
  "type": "object"
}

Fields:

id pydantic-field

id: str

The unique ID of the prompt template.

variables pydantic-field

variables: dict[str, str] | None = None

Variables to substitute in the prompt template.

StreamOptionsParam pydantic-model

Show JSON schema:
{
  "properties": {
    "include_usage": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If set, an additional chunk will be streamed with usage statistics.",
      "title": "Include Usage"
    }
  },
  "title": "StreamOptionsParam",
  "type": "object"
}

Fields:

include_usage pydantic-field

include_usage: bool | None = None

If set, an additional chunk will be streamed with usage statistics.


Response Types

ResponsesResponse pydantic-model

OpenAI Responses API response object.

Show JSON schema:
{
  "$defs": {
    "AnnotationContainerFileCitation": {
      "properties": {
        "container_id": {
          "description": "The ID of the container.",
          "title": "Container Id",
          "type": "string"
        },
        "end_index": {
          "description": "The index of the last character of the citation.",
          "title": "End Index",
          "type": "integer"
        },
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the container file cited.",
          "title": "Filename",
          "type": "string"
        },
        "start_index": {
          "description": "The index of the first character of the citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "type": {
          "const": "container_file_citation",
          "description": "Always 'container_file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "container_id",
        "end_index",
        "file_id",
        "filename",
        "start_index",
        "type"
      ],
      "title": "AnnotationContainerFileCitation",
      "type": "object"
    },
    "AnnotationFileCitation": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the file cited.",
          "title": "Filename",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_citation",
          "description": "Always 'file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "filename",
        "index",
        "type"
      ],
      "title": "AnnotationFileCitation",
      "type": "object"
    },
    "AnnotationFilePath": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_path",
          "description": "Always 'file_path'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "index",
        "type"
      ],
      "title": "AnnotationFilePath",
      "type": "object"
    },
    "AnnotationURLCitation": {
      "properties": {
        "end_index": {
          "description": "The index of the last character of the URL citation.",
          "title": "End Index",
          "type": "integer"
        },
        "start_index": {
          "description": "The index of the first character of the URL citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "title": {
          "description": "The title of the web resource.",
          "title": "Title",
          "type": "string"
        },
        "type": {
          "const": "url_citation",
          "description": "Always 'url_citation'.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the web resource.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "end_index",
        "start_index",
        "title",
        "type",
        "url"
      ],
      "title": "AnnotationURLCitation",
      "type": "object"
    },
    "ApplyPatchToolCall": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "const": "apply_patch_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "call_id": {
          "description": "The tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "status": {
          "description": "The status.",
          "enum": [
            "in_progress",
            "completed"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "type",
        "call_id",
        "status"
      ],
      "title": "ApplyPatchToolCall",
      "type": "object"
    },
    "CodeInterpreterOutputImage": {
      "properties": {
        "type": {
          "const": "image",
          "description": "Always 'image'.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the image output.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "title": "CodeInterpreterOutputImage",
      "type": "object"
    },
    "CodeInterpreterOutputLogs": {
      "properties": {
        "logs": {
          "description": "The logs output from the code interpreter.",
          "title": "Logs",
          "type": "string"
        },
        "type": {
          "const": "logs",
          "description": "Always 'logs'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "logs",
        "type"
      ],
      "title": "CodeInterpreterOutputLogs",
      "type": "object"
    },
    "CodeInterpreterToolCall": {
      "properties": {
        "type": {
          "const": "code_interpreter_call",
          "description": "The type of the tool call.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the code interpreter tool call.",
          "title": "Id",
          "type": "string"
        },
        "code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The code that was executed.",
          "title": "Code"
        },
        "container_id": {
          "description": "The ID of the container used to run the code.",
          "title": "Container Id",
          "type": "string"
        },
        "outputs": {
          "anyOf": [
            {
              "items": {
                "discriminator": {
                  "mapping": {
                    "image": "#/$defs/CodeInterpreterOutputImage",
                    "logs": "#/$defs/CodeInterpreterOutputLogs"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/$defs/CodeInterpreterOutputLogs"
                  },
                  {
                    "$ref": "#/$defs/CodeInterpreterOutputImage"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The outputs from the code execution.",
          "title": "Outputs"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete",
                "interpreting",
                "failed"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the tool call.",
          "title": "Status"
        }
      },
      "required": [
        "type",
        "id",
        "container_id"
      ],
      "title": "CodeInterpreterToolCall",
      "type": "object"
    },
    "ComputerActionClick": {
      "properties": {
        "button": {
          "description": "Which mouse button was pressed.",
          "enum": [
            "left",
            "right",
            "wheel",
            "back",
            "forward"
          ],
          "title": "Button",
          "type": "string"
        },
        "type": {
          "const": "click",
          "description": "Always 'click'.",
          "title": "Type",
          "type": "string"
        },
        "x": {
          "description": "The x-coordinate.",
          "title": "X",
          "type": "integer"
        },
        "y": {
          "description": "The y-coordinate.",
          "title": "Y",
          "type": "integer"
        }
      },
      "required": [
        "button",
        "type",
        "x",
        "y"
      ],
      "title": "ComputerActionClick",
      "type": "object"
    },
    "ComputerActionDoubleClick": {
      "properties": {
        "type": {
          "const": "double_click",
          "description": "Always 'double_click'.",
          "title": "Type",
          "type": "string"
        },
        "x": {
          "description": "The x-coordinate.",
          "title": "X",
          "type": "integer"
        },
        "y": {
          "description": "The y-coordinate.",
          "title": "Y",
          "type": "integer"
        }
      },
      "required": [
        "type",
        "x",
        "y"
      ],
      "title": "ComputerActionDoubleClick",
      "type": "object"
    },
    "ComputerActionDrag": {
      "properties": {
        "path": {
          "description": "Coordinates representing the drag path.",
          "items": {
            "$ref": "#/$defs/ComputerActionDragPath"
          },
          "title": "Path",
          "type": "array"
        },
        "type": {
          "const": "drag",
          "description": "Always 'drag'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "path",
        "type"
      ],
      "title": "ComputerActionDrag",
      "type": "object"
    },
    "ComputerActionDragPath": {
      "properties": {
        "x": {
          "description": "The x-coordinate.",
          "title": "X",
          "type": "integer"
        },
        "y": {
          "description": "The y-coordinate.",
          "title": "Y",
          "type": "integer"
        }
      },
      "required": [
        "x",
        "y"
      ],
      "title": "ComputerActionDragPath",
      "type": "object"
    },
    "ComputerActionKeypress": {
      "properties": {
        "keys": {
          "description": "The combination of keys to press.",
          "items": {
            "type": "string"
          },
          "title": "Keys",
          "type": "array"
        },
        "type": {
          "const": "keypress",
          "description": "Always 'keypress'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "keys",
        "type"
      ],
      "title": "ComputerActionKeypress",
      "type": "object"
    },
    "ComputerActionMove": {
      "properties": {
        "type": {
          "const": "move",
          "description": "Always 'move'.",
          "title": "Type",
          "type": "string"
        },
        "x": {
          "description": "The x-coordinate.",
          "title": "X",
          "type": "integer"
        },
        "y": {
          "description": "The y-coordinate.",
          "title": "Y",
          "type": "integer"
        }
      },
      "required": [
        "type",
        "x",
        "y"
      ],
      "title": "ComputerActionMove",
      "type": "object"
    },
    "ComputerActionScreenshot": {
      "properties": {
        "type": {
          "const": "screenshot",
          "description": "Always 'screenshot'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ComputerActionScreenshot",
      "type": "object"
    },
    "ComputerActionScroll": {
      "properties": {
        "scroll_x": {
          "description": "The horizontal scroll distance.",
          "title": "Scroll X",
          "type": "integer"
        },
        "scroll_y": {
          "description": "The vertical scroll distance.",
          "title": "Scroll Y",
          "type": "integer"
        },
        "type": {
          "const": "scroll",
          "description": "Always 'scroll'.",
          "title": "Type",
          "type": "string"
        },
        "x": {
          "description": "The x-coordinate.",
          "title": "X",
          "type": "integer"
        },
        "y": {
          "description": "The y-coordinate.",
          "title": "Y",
          "type": "integer"
        }
      },
      "required": [
        "scroll_x",
        "scroll_y",
        "type",
        "x",
        "y"
      ],
      "title": "ComputerActionScroll",
      "type": "object"
    },
    "ComputerActionType": {
      "properties": {
        "text": {
          "description": "The text to type.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "type",
          "description": "Always 'type'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ComputerActionType",
      "type": "object"
    },
    "ComputerActionWait": {
      "properties": {
        "type": {
          "const": "wait",
          "description": "Always 'wait'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ComputerActionWait",
      "type": "object"
    },
    "ComputerPendingSafetyCheck": {
      "properties": {
        "id": {
          "description": "The ID of the pending safety check.",
          "title": "Id",
          "type": "string"
        },
        "code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The type of the pending safety check.",
          "title": "Code"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Details about the pending safety check.",
          "title": "Message"
        }
      },
      "required": [
        "id"
      ],
      "title": "ComputerPendingSafetyCheck",
      "type": "object"
    },
    "ComputerToolCall": {
      "properties": {
        "type": {
          "const": "computer_call",
          "description": "The type of the tool call.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the computer call.",
          "title": "Id",
          "type": "string"
        },
        "action": {
          "description": "The action performed by the computer tool.",
          "discriminator": {
            "mapping": {
              "click": "#/$defs/ComputerActionClick",
              "double_click": "#/$defs/ComputerActionDoubleClick",
              "drag": "#/$defs/ComputerActionDrag",
              "keypress": "#/$defs/ComputerActionKeypress",
              "move": "#/$defs/ComputerActionMove",
              "screenshot": "#/$defs/ComputerActionScreenshot",
              "scroll": "#/$defs/ComputerActionScroll",
              "type": "#/$defs/ComputerActionType",
              "wait": "#/$defs/ComputerActionWait"
            },
            "propertyName": "type"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/ComputerActionClick"
            },
            {
              "$ref": "#/$defs/ComputerActionDoubleClick"
            },
            {
              "$ref": "#/$defs/ComputerActionDrag"
            },
            {
              "$ref": "#/$defs/ComputerActionKeypress"
            },
            {
              "$ref": "#/$defs/ComputerActionMove"
            },
            {
              "$ref": "#/$defs/ComputerActionScreenshot"
            },
            {
              "$ref": "#/$defs/ComputerActionScroll"
            },
            {
              "$ref": "#/$defs/ComputerActionType"
            },
            {
              "$ref": "#/$defs/ComputerActionWait"
            }
          ],
          "title": "Action"
        },
        "call_id": {
          "description": "An identifier used when responding to the tool call with output.",
          "title": "Call Id",
          "type": "string"
        },
        "pending_safety_checks": {
          "description": "The pending safety checks.",
          "items": {
            "$ref": "#/$defs/ComputerPendingSafetyCheck"
          },
          "title": "Pending Safety Checks",
          "type": "array"
        },
        "status": {
          "description": "The status of the tool call.",
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "action",
        "call_id",
        "status"
      ],
      "title": "ComputerToolCall",
      "type": "object"
    },
    "ConversationInfo": {
      "properties": {
        "id": {
          "description": "The unique ID of the conversation.",
          "title": "Id",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "title": "ConversationInfo",
      "type": "object"
    },
    "FileSearchResult": {
      "properties": {
        "attributes": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata key-value pairs.",
          "title": "Attributes"
        },
        "file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the file.",
          "title": "File Id"
        },
        "filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The name of the file.",
          "title": "Filename"
        },
        "score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The relevance score of the file (0-1).",
          "title": "Score"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The text that was retrieved from the file.",
          "title": "Text"
        }
      },
      "title": "FileSearchResult",
      "type": "object"
    },
    "FileSearchToolCall": {
      "properties": {
        "type": {
          "const": "file_search_call",
          "description": "The type of the tool call.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the file search tool call.",
          "title": "Id",
          "type": "string"
        },
        "queries": {
          "description": "The queries used to search for files.",
          "items": {
            "type": "string"
          },
          "title": "Queries",
          "type": "array"
        },
        "status": {
          "description": "The status of the tool call.",
          "enum": [
            "in_progress",
            "searching",
            "completed",
            "incomplete",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        },
        "results": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/FileSearchResult"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The results of the file search.",
          "title": "Results"
        }
      },
      "required": [
        "type",
        "id",
        "status"
      ],
      "title": "FileSearchToolCall",
      "type": "object"
    },
    "FunctionShellToolCall": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "const": "shell_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "call_id": {
          "description": "The tool call ID.",
          "title": "Call Id",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID.",
          "title": "Id"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "type",
        "call_id"
      ],
      "title": "FunctionShellToolCall",
      "type": "object"
    },
    "FunctionToolCall": {
      "properties": {
        "type": {
          "const": "function_call",
          "description": "The type of the tool call.",
          "title": "Type",
          "type": "string"
        },
        "call_id": {
          "description": "The unique ID of the function tool call generated by the model.",
          "title": "Call Id",
          "type": "string"
        },
        "name": {
          "description": "The name of the function to call.",
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "description": "The arguments to call the function with, as a JSON string.",
          "title": "Arguments",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the function tool call.",
          "title": "Id"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the tool call.",
          "title": "Status"
        }
      },
      "required": [
        "type",
        "call_id",
        "name",
        "arguments"
      ],
      "title": "FunctionToolCall",
      "type": "object"
    },
    "ImageGenerationCall": {
      "properties": {
        "type": {
          "const": "image_generation_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the image generation call.",
          "title": "Id",
          "type": "string"
        },
        "result": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The generated image encoded in base64.",
          "title": "Result"
        },
        "status": {
          "description": "The status of the image generation call.",
          "enum": [
            "in_progress",
            "completed",
            "generating",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "status"
      ],
      "title": "ImageGenerationCall",
      "type": "object"
    },
    "IncompleteDetails": {
      "properties": {
        "reason": {
          "anyOf": [
            {
              "enum": [
                "max_output_tokens",
                "content_filter"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The reason why the response is incomplete.",
          "title": "Reason"
        }
      },
      "title": "IncompleteDetails",
      "type": "object"
    },
    "InputTokensDetails": {
      "properties": {
        "cached_tokens": {
          "description": "The number of tokens that were retrieved from the cache.",
          "title": "Cached Tokens",
          "type": "integer"
        }
      },
      "required": [
        "cached_tokens"
      ],
      "title": "InputTokensDetails",
      "type": "object"
    },
    "LocalShellCall": {
      "properties": {
        "type": {
          "const": "local_shell_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the local shell call.",
          "title": "Id",
          "type": "string"
        },
        "action": {
          "$ref": "#/$defs/LocalShellCallAction",
          "description": "The shell command to execute."
        },
        "call_id": {
          "description": "The unique ID of the tool call generated by the model.",
          "title": "Call Id",
          "type": "string"
        },
        "status": {
          "description": "The status of the call.",
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "action",
        "call_id",
        "status"
      ],
      "title": "LocalShellCall",
      "type": "object"
    },
    "LocalShellCallAction": {
      "properties": {
        "command": {
          "description": "The command to run.",
          "items": {
            "type": "string"
          },
          "title": "Command",
          "type": "array"
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables.",
          "title": "Env",
          "type": "object"
        },
        "type": {
          "const": "exec",
          "description": "Always 'exec'.",
          "title": "Type",
          "type": "string"
        },
        "timeout_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional timeout in milliseconds.",
          "title": "Timeout Ms"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional user to run the command as.",
          "title": "User"
        },
        "working_directory": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional working directory.",
          "title": "Working Directory"
        }
      },
      "required": [
        "command",
        "type"
      ],
      "title": "LocalShellCallAction",
      "type": "object"
    },
    "McpApprovalRequest": {
      "properties": {
        "type": {
          "const": "mcp_approval_request",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the approval request.",
          "title": "Id",
          "type": "string"
        },
        "arguments": {
          "description": "A JSON string of arguments for the tool.",
          "title": "Arguments",
          "type": "string"
        },
        "name": {
          "description": "The name of the tool to run.",
          "title": "Name",
          "type": "string"
        },
        "server_label": {
          "description": "The label of the MCP server making the request.",
          "title": "Server Label",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "arguments",
        "name",
        "server_label"
      ],
      "title": "McpApprovalRequest",
      "type": "object"
    },
    "McpCall": {
      "properties": {
        "type": {
          "const": "mcp_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the tool call.",
          "title": "Id",
          "type": "string"
        },
        "arguments": {
          "description": "A JSON string of the arguments passed to the tool.",
          "title": "Arguments",
          "type": "string"
        },
        "name": {
          "description": "The name of the tool that was run.",
          "title": "Name",
          "type": "string"
        },
        "server_label": {
          "description": "The label of the MCP server running the tool.",
          "title": "Server Label",
          "type": "string"
        },
        "approval_request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique ID for the approval request.",
          "title": "Approval Request Id"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The error from the tool call, if any.",
          "title": "Error"
        },
        "output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The output from the tool call.",
          "title": "Output"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete",
                "calling",
                "failed"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status.",
          "title": "Status"
        }
      },
      "required": [
        "type",
        "id",
        "arguments",
        "name",
        "server_label"
      ],
      "title": "McpCall",
      "type": "object"
    },
    "McpListTools": {
      "properties": {
        "type": {
          "const": "mcp_list_tools",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the list.",
          "title": "Id",
          "type": "string"
        },
        "server_label": {
          "description": "The label of the MCP server.",
          "title": "Server Label",
          "type": "string"
        },
        "tools": {
          "description": "The tools available on the server.",
          "items": {
            "$ref": "#/$defs/McpListToolsTool"
          },
          "title": "Tools",
          "type": "array"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Error message if the server could not list tools.",
          "title": "Error"
        }
      },
      "required": [
        "type",
        "id",
        "server_label",
        "tools"
      ],
      "title": "McpListTools",
      "type": "object"
    },
    "McpListToolsTool": {
      "properties": {
        "input_schema": {
          "additionalProperties": true,
          "description": "The JSON schema describing the tool's input.",
          "title": "Input Schema",
          "type": "object"
        },
        "name": {
          "description": "The name of the tool.",
          "title": "Name",
          "type": "string"
        },
        "annotations": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Additional annotations about the tool.",
          "title": "Annotations"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The description of the tool.",
          "title": "Description"
        }
      },
      "required": [
        "input_schema",
        "name"
      ],
      "title": "McpListToolsTool",
      "type": "object"
    },
    "OutputText": {
      "properties": {
        "type": {
          "const": "output_text",
          "description": "The type of the output content.",
          "title": "Type",
          "type": "string"
        },
        "text": {
          "description": "The text content.",
          "title": "Text",
          "type": "string"
        },
        "annotations": {
          "description": "Annotations for the text.",
          "items": {
            "discriminator": {
              "mapping": {
                "container_file_citation": "#/$defs/AnnotationContainerFileCitation",
                "file_citation": "#/$defs/AnnotationFileCitation",
                "file_path": "#/$defs/AnnotationFilePath",
                "url_citation": "#/$defs/AnnotationURLCitation"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/AnnotationFileCitation"
              },
              {
                "$ref": "#/$defs/AnnotationURLCitation"
              },
              {
                "$ref": "#/$defs/AnnotationContainerFileCitation"
              },
              {
                "$ref": "#/$defs/AnnotationFilePath"
              }
            ]
          },
          "title": "Annotations",
          "type": "array"
        },
        "logprobs": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/OutputTextLogprob"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Log probability information.",
          "title": "Logprobs"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "title": "OutputText",
      "type": "object"
    },
    "OutputTextLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        },
        "top_logprobs": {
          "description": "List of the most likely tokens and their log probability.",
          "items": {
            "$ref": "#/$defs/OutputTextLogprobTopLogprob"
          },
          "title": "Top Logprobs",
          "type": "array"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob",
        "top_logprobs"
      ],
      "title": "OutputTextLogprob",
      "type": "object"
    },
    "OutputTextLogprobTopLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob"
      ],
      "title": "OutputTextLogprobTopLogprob",
      "type": "object"
    },
    "OutputTokensDetails": {
      "properties": {
        "reasoning_tokens": {
          "description": "The number of reasoning tokens.",
          "title": "Reasoning Tokens",
          "type": "integer"
        }
      },
      "required": [
        "reasoning_tokens"
      ],
      "title": "OutputTokensDetails",
      "type": "object"
    },
    "ReasoningContent": {
      "properties": {
        "text": {
          "description": "The reasoning text from the model.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "reasoning_text",
          "description": "Always 'reasoning_text'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ReasoningContent",
      "type": "object"
    },
    "ReasoningItem": {
      "properties": {
        "id": {
          "description": "The unique identifier of the reasoning content.",
          "title": "Id",
          "type": "string"
        },
        "type": {
          "const": "reasoning",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "summary": {
          "description": "Reasoning summary content.",
          "items": {
            "$ref": "#/$defs/ReasoningSummary"
          },
          "title": "Summary",
          "type": "array"
        },
        "content": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ReasoningContent"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Reasoning text content.",
          "title": "Content"
        },
        "encrypted_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Encrypted content for multi-turn.",
          "title": "Encrypted Content"
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "in_progress",
                "completed",
                "incomplete"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The status of the reasoning item.",
          "title": "Status"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "title": "ReasoningItem",
      "type": "object"
    },
    "ReasoningSummary": {
      "properties": {
        "text": {
          "description": "A summary of the reasoning output.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "summary_text",
          "description": "Always 'summary_text'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ReasoningSummary",
      "type": "object"
    },
    "Refusal": {
      "properties": {
        "type": {
          "const": "refusal",
          "description": "The type of the output content.",
          "title": "Type",
          "type": "string"
        },
        "refusal": {
          "description": "The refusal message generated by the model.",
          "title": "Refusal",
          "type": "string"
        }
      },
      "required": [
        "type",
        "refusal"
      ],
      "title": "Refusal",
      "type": "object"
    },
    "ResponseCustomToolCall": {
      "properties": {
        "type": {
          "const": "custom_tool_call",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "call_id": {
          "description": "An identifier used to map this call to output.",
          "title": "Call Id",
          "type": "string"
        },
        "name": {
          "description": "The name of the custom tool being called.",
          "title": "Name",
          "type": "string"
        },
        "input": {
          "description": "The input for the custom tool call.",
          "title": "Input",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the custom tool call.",
          "title": "Id"
        }
      },
      "required": [
        "type",
        "call_id",
        "name",
        "input"
      ],
      "title": "ResponseCustomToolCall",
      "type": "object"
    },
    "ResponseError": {
      "properties": {
        "code": {
          "description": "The error code.",
          "title": "Code",
          "type": "string"
        },
        "message": {
          "description": "A human-readable error message.",
          "title": "Message",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "ResponseError",
      "type": "object"
    },
    "ResponseOutputMessage": {
      "properties": {
        "id": {
          "description": "The unique ID of the output message.",
          "title": "Id",
          "type": "string"
        },
        "type": {
          "const": "message",
          "description": "The type of the output item.",
          "title": "Type",
          "type": "string"
        },
        "role": {
          "const": "assistant",
          "description": "The role of the message. Always 'assistant'.",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "description": "The content items of the message.",
          "items": {
            "discriminator": {
              "mapping": {
                "output_text": "#/$defs/OutputText",
                "refusal": "#/$defs/Refusal"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/OutputText"
              },
              {
                "$ref": "#/$defs/Refusal"
              }
            ]
          },
          "title": "Content",
          "type": "array"
        },
        "status": {
          "description": "The status of the message.",
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "role",
        "content",
        "status"
      ],
      "title": "ResponseOutputMessage",
      "type": "object"
    },
    "ResponsePromptInfo": {
      "properties": {
        "id": {
          "description": "The unique ID of the prompt template.",
          "title": "Id",
          "type": "string"
        },
        "variables": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Variables used in the prompt template.",
          "title": "Variables"
        }
      },
      "required": [
        "id"
      ],
      "title": "ResponsePromptInfo",
      "type": "object"
    },
    "ResponseUsage": {
      "properties": {
        "input_tokens": {
          "description": "The number of input tokens.",
          "title": "Input Tokens",
          "type": "integer"
        },
        "input_tokens_details": {
          "$ref": "#/$defs/InputTokensDetails",
          "description": "A detailed breakdown of the input tokens."
        },
        "output_tokens": {
          "description": "The number of output tokens.",
          "title": "Output Tokens",
          "type": "integer"
        },
        "output_tokens_details": {
          "$ref": "#/$defs/OutputTokensDetails",
          "description": "A detailed breakdown of the output tokens."
        },
        "total_tokens": {
          "description": "The total number of tokens used.",
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "required": [
        "input_tokens",
        "input_tokens_details",
        "output_tokens",
        "output_tokens_details",
        "total_tokens"
      ],
      "title": "ResponseUsage",
      "type": "object"
    },
    "ToolInfo": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "description": "The type of the tool.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ToolInfo",
      "type": "object"
    },
    "WebSearchActionFind": {
      "properties": {
        "pattern": {
          "description": "The pattern or text to search for within the page.",
          "title": "Pattern",
          "type": "string"
        },
        "type": {
          "const": "find",
          "description": "The action type.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the page searched.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "pattern",
        "type",
        "url"
      ],
      "title": "WebSearchActionFind",
      "type": "object"
    },
    "WebSearchActionOpenPage": {
      "properties": {
        "type": {
          "const": "open_page",
          "description": "The action type.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL opened by the model.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "title": "WebSearchActionOpenPage",
      "type": "object"
    },
    "WebSearchActionSearch": {
      "properties": {
        "query": {
          "description": "The search query.",
          "title": "Query",
          "type": "string"
        },
        "type": {
          "const": "search",
          "description": "The action type.",
          "title": "Type",
          "type": "string"
        },
        "queries": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The search queries.",
          "title": "Queries"
        },
        "sources": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/WebSearchActionSource"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The sources used.",
          "title": "Sources"
        }
      },
      "required": [
        "query",
        "type"
      ],
      "title": "WebSearchActionSearch",
      "type": "object"
    },
    "WebSearchActionSource": {
      "properties": {
        "type": {
          "const": "url",
          "description": "Always 'url'.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the source.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "title": "WebSearchActionSource",
      "type": "object"
    },
    "WebSearchToolCall": {
      "properties": {
        "type": {
          "const": "web_search_call",
          "description": "The type of the tool call.",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "description": "The unique ID of the web search tool call.",
          "title": "Id",
          "type": "string"
        },
        "action": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "find": "#/$defs/WebSearchActionFind",
                  "open_page": "#/$defs/WebSearchActionOpenPage",
                  "search": "#/$defs/WebSearchActionSearch"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/WebSearchActionSearch"
                },
                {
                  "$ref": "#/$defs/WebSearchActionOpenPage"
                },
                {
                  "$ref": "#/$defs/WebSearchActionFind"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The action taken.",
          "title": "Action"
        },
        "status": {
          "description": "The status of the tool call.",
          "enum": [
            "in_progress",
            "searching",
            "completed",
            "failed"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "status"
      ],
      "title": "WebSearchToolCall",
      "type": "object"
    }
  },
  "description": "OpenAI Responses API response object.",
  "properties": {
    "id": {
      "description": "Unique identifier for this Response.",
      "title": "Id",
      "type": "string"
    },
    "object": {
      "const": "response",
      "description": "The object type - always 'response'.",
      "title": "Object",
      "type": "string"
    },
    "created_at": {
      "description": "Unix timestamp (in seconds) of when this Response was created.",
      "title": "Created At",
      "type": "number"
    },
    "model": {
      "description": "Model ID used to generate the response.",
      "title": "Model",
      "type": "string"
    },
    "output": {
      "description": "An array of content items generated by the model.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/ResponseOutputMessage"
          },
          {
            "$ref": "#/$defs/FunctionToolCall"
          },
          {
            "$ref": "#/$defs/FileSearchToolCall"
          },
          {
            "$ref": "#/$defs/WebSearchToolCall"
          },
          {
            "$ref": "#/$defs/CodeInterpreterToolCall"
          },
          {
            "$ref": "#/$defs/ComputerToolCall"
          },
          {
            "$ref": "#/$defs/ReasoningItem"
          },
          {
            "$ref": "#/$defs/ImageGenerationCall"
          },
          {
            "$ref": "#/$defs/LocalShellCall"
          },
          {
            "$ref": "#/$defs/FunctionShellToolCall"
          },
          {
            "$ref": "#/$defs/ApplyPatchToolCall"
          },
          {
            "$ref": "#/$defs/McpCall"
          },
          {
            "$ref": "#/$defs/McpListTools"
          },
          {
            "$ref": "#/$defs/McpApprovalRequest"
          },
          {
            "$ref": "#/$defs/ResponseCustomToolCall"
          },
          {
            "additionalProperties": true,
            "type": "object"
          }
        ]
      },
      "title": "Output",
      "type": "array"
    },
    "parallel_tool_calls": {
      "description": "Whether the model can run tool calls in parallel.",
      "title": "Parallel Tool Calls",
      "type": "boolean"
    },
    "tool_choice": {
      "anyOf": [
        {
          "enum": [
            "none",
            "auto",
            "required"
          ],
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ],
      "description": "How the model should select which tool to use.",
      "title": "Tool Choice"
    },
    "tools": {
      "description": "An array of tools the model may call.",
      "items": {
        "$ref": "#/$defs/ToolInfo"
      },
      "title": "Tools",
      "type": "array"
    },
    "status": {
      "anyOf": [
        {
          "enum": [
            "completed",
            "failed",
            "in_progress",
            "cancelled",
            "queued",
            "incomplete"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the response generation.",
      "title": "Status"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponseError"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "An error object if the model fails."
    },
    "incomplete_details": {
      "anyOf": [
        {
          "$ref": "#/$defs/IncompleteDetails"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Details about why the response is incomplete."
    },
    "instructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A system (or developer) message.",
      "title": "Instructions"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Key-value pairs for additional information.",
      "title": "Metadata"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Sampling temperature (0-2).",
      "title": "Temperature"
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Nucleus sampling parameter.",
      "title": "Top P"
    },
    "background": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether to run in the background.",
      "title": "Background"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Unix timestamp (in seconds) of when this Response was completed.",
      "title": "Completed At"
    },
    "conversation": {
      "anyOf": [
        {
          "$ref": "#/$defs/ConversationInfo"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The conversation this response belongs to."
    },
    "max_output_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Upper bound for generated tokens.",
      "title": "Max Output Tokens"
    },
    "max_tool_calls": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The maximum number of calls to built-in tools.",
      "title": "Max Tool Calls"
    },
    "previous_response_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the previous response.",
      "title": "Previous Response Id"
    },
    "prompt": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponsePromptInfo"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reference to a prompt template."
    },
    "prompt_cache_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Used for prompt caching optimization.",
      "title": "Prompt Cache Key"
    },
    "prompt_cache_retention": {
      "anyOf": [
        {
          "enum": [
            "in-memory",
            "24h"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Retention policy for prompt cache.",
      "title": "Prompt Cache Retention"
    },
    "reasoning": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Configuration for reasoning models.",
      "title": "Reasoning"
    },
    "safety_identifier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Identifier for abuse detection.",
      "title": "Safety Identifier"
    },
    "service_tier": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "default",
            "flex",
            "scale",
            "priority"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Processing type used for serving the request.",
      "title": "Service Tier"
    },
    "text": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Configuration for text response.",
      "title": "Text"
    },
    "top_logprobs": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of most likely tokens to return (0-20).",
      "title": "Top Logprobs"
    },
    "truncation": {
      "anyOf": [
        {
          "enum": [
            "auto",
            "disabled"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Truncation strategy.",
      "title": "Truncation"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponseUsage"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Token usage details."
    },
    "user": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Deprecated: use safety_identifier and prompt_cache_key.",
      "title": "User"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Sequrity session ID.",
      "title": "Session Id"
    }
  },
  "required": [
    "id",
    "object",
    "created_at",
    "model",
    "output",
    "parallel_tool_calls",
    "tool_choice",
    "tools"
  ],
  "title": "ResponsesResponse",
  "type": "object"
}

Config:

  • extra: ignore

Fields:

id pydantic-field

id: str

Unique identifier for this Response.

object pydantic-field

object: Literal['response']

The object type - always 'response'.

created_at pydantic-field

created_at: float

Unix timestamp (in seconds) of when this Response was created.

model pydantic-field

model: str

Model ID used to generate the response.

output pydantic-field

output: list[ResponseOutputItem]

An array of content items generated by the model.

parallel_tool_calls pydantic-field

parallel_tool_calls: bool

Whether the model can run tool calls in parallel.

tool_choice pydantic-field

tool_choice: Literal['none', 'auto', 'required'] | dict[str, Any]

How the model should select which tool to use.

tools pydantic-field

tools: list[ToolInfo]

An array of tools the model may call.

status pydantic-field

status: (
    Literal["completed", "failed", "in_progress", "cancelled", "queued", "incomplete"]
    | None
) = None

The status of the response generation.

error pydantic-field

error: ResponseError | None = None

An error object if the model fails.

incomplete_details pydantic-field

incomplete_details: IncompleteDetails | None = None

Details about why the response is incomplete.

instructions pydantic-field

instructions: str | list[dict[str, Any]] | None = None

A system (or developer) message.

metadata pydantic-field

metadata: dict[str, str] | None = None

Key-value pairs for additional information.

temperature pydantic-field

temperature: float | None = None

Sampling temperature (0-2).

top_p pydantic-field

top_p: float | None = None

Nucleus sampling parameter.

background pydantic-field

background: bool | None = None

Whether to run in the background.

completed_at pydantic-field

completed_at: float | None = None

Unix timestamp (in seconds) of when this Response was completed.

conversation pydantic-field

conversation: ConversationInfo | None = None

The conversation this response belongs to.

max_output_tokens pydantic-field

max_output_tokens: int | None = None

Upper bound for generated tokens.

max_tool_calls pydantic-field

max_tool_calls: int | None = None

The maximum number of calls to built-in tools.

previous_response_id pydantic-field

previous_response_id: str | None = None

The ID of the previous response.

prompt pydantic-field

prompt: ResponsePromptInfo | None = None

Reference to a prompt template.

prompt_cache_key pydantic-field

prompt_cache_key: str | None = None

Used for prompt caching optimization.

prompt_cache_retention pydantic-field

prompt_cache_retention: Literal['in-memory', '24h'] | None = None

Retention policy for prompt cache.

reasoning pydantic-field

reasoning: dict[str, Any] | None = None

Configuration for reasoning models.

safety_identifier pydantic-field

safety_identifier: str | None = None

Identifier for abuse detection.

service_tier pydantic-field

service_tier: Literal['auto', 'default', 'flex', 'scale', 'priority'] | None = None

Processing type used for serving the request.

text pydantic-field

text: dict[str, Any] | None = None

Configuration for text response.

top_logprobs pydantic-field

top_logprobs: int | None = None

Number of most likely tokens to return (0-20).

truncation pydantic-field

truncation: Literal['auto', 'disabled'] | None = None

Truncation strategy.

usage pydantic-field

usage: ResponseUsage | None = None

Token usage details.

user pydantic-field

user: str | None = None

Deprecated: use safety_identifier and prompt_cache_key.

session_id pydantic-field

session_id: str | None = None

Sequrity session ID.

output_text property

output_text: str

Convenience property that aggregates all output_text items from the output list.

ResponseOutputMessage pydantic-model

Show JSON schema:
{
  "$defs": {
    "AnnotationContainerFileCitation": {
      "properties": {
        "container_id": {
          "description": "The ID of the container.",
          "title": "Container Id",
          "type": "string"
        },
        "end_index": {
          "description": "The index of the last character of the citation.",
          "title": "End Index",
          "type": "integer"
        },
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the container file cited.",
          "title": "Filename",
          "type": "string"
        },
        "start_index": {
          "description": "The index of the first character of the citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "type": {
          "const": "container_file_citation",
          "description": "Always 'container_file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "container_id",
        "end_index",
        "file_id",
        "filename",
        "start_index",
        "type"
      ],
      "title": "AnnotationContainerFileCitation",
      "type": "object"
    },
    "AnnotationFileCitation": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the file cited.",
          "title": "Filename",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_citation",
          "description": "Always 'file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "filename",
        "index",
        "type"
      ],
      "title": "AnnotationFileCitation",
      "type": "object"
    },
    "AnnotationFilePath": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_path",
          "description": "Always 'file_path'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "index",
        "type"
      ],
      "title": "AnnotationFilePath",
      "type": "object"
    },
    "AnnotationURLCitation": {
      "properties": {
        "end_index": {
          "description": "The index of the last character of the URL citation.",
          "title": "End Index",
          "type": "integer"
        },
        "start_index": {
          "description": "The index of the first character of the URL citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "title": {
          "description": "The title of the web resource.",
          "title": "Title",
          "type": "string"
        },
        "type": {
          "const": "url_citation",
          "description": "Always 'url_citation'.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the web resource.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "end_index",
        "start_index",
        "title",
        "type",
        "url"
      ],
      "title": "AnnotationURLCitation",
      "type": "object"
    },
    "OutputText": {
      "properties": {
        "type": {
          "const": "output_text",
          "description": "The type of the output content.",
          "title": "Type",
          "type": "string"
        },
        "text": {
          "description": "The text content.",
          "title": "Text",
          "type": "string"
        },
        "annotations": {
          "description": "Annotations for the text.",
          "items": {
            "discriminator": {
              "mapping": {
                "container_file_citation": "#/$defs/AnnotationContainerFileCitation",
                "file_citation": "#/$defs/AnnotationFileCitation",
                "file_path": "#/$defs/AnnotationFilePath",
                "url_citation": "#/$defs/AnnotationURLCitation"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/AnnotationFileCitation"
              },
              {
                "$ref": "#/$defs/AnnotationURLCitation"
              },
              {
                "$ref": "#/$defs/AnnotationContainerFileCitation"
              },
              {
                "$ref": "#/$defs/AnnotationFilePath"
              }
            ]
          },
          "title": "Annotations",
          "type": "array"
        },
        "logprobs": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/OutputTextLogprob"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Log probability information.",
          "title": "Logprobs"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "title": "OutputText",
      "type": "object"
    },
    "OutputTextLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        },
        "top_logprobs": {
          "description": "List of the most likely tokens and their log probability.",
          "items": {
            "$ref": "#/$defs/OutputTextLogprobTopLogprob"
          },
          "title": "Top Logprobs",
          "type": "array"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob",
        "top_logprobs"
      ],
      "title": "OutputTextLogprob",
      "type": "object"
    },
    "OutputTextLogprobTopLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob"
      ],
      "title": "OutputTextLogprobTopLogprob",
      "type": "object"
    },
    "Refusal": {
      "properties": {
        "type": {
          "const": "refusal",
          "description": "The type of the output content.",
          "title": "Type",
          "type": "string"
        },
        "refusal": {
          "description": "The refusal message generated by the model.",
          "title": "Refusal",
          "type": "string"
        }
      },
      "required": [
        "type",
        "refusal"
      ],
      "title": "Refusal",
      "type": "object"
    }
  },
  "properties": {
    "id": {
      "description": "The unique ID of the output message.",
      "title": "Id",
      "type": "string"
    },
    "type": {
      "const": "message",
      "description": "The type of the output item.",
      "title": "Type",
      "type": "string"
    },
    "role": {
      "const": "assistant",
      "description": "The role of the message. Always 'assistant'.",
      "title": "Role",
      "type": "string"
    },
    "content": {
      "description": "The content items of the message.",
      "items": {
        "discriminator": {
          "mapping": {
            "output_text": "#/$defs/OutputText",
            "refusal": "#/$defs/Refusal"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/OutputText"
          },
          {
            "$ref": "#/$defs/Refusal"
          }
        ]
      },
      "title": "Content",
      "type": "array"
    },
    "status": {
      "description": "The status of the message.",
      "enum": [
        "in_progress",
        "completed",
        "incomplete"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "required": [
    "id",
    "type",
    "role",
    "content",
    "status"
  ],
  "title": "ResponseOutputMessage",
  "type": "object"
}

Fields:

id pydantic-field

id: str

The unique ID of the output message.

type pydantic-field

type: Literal['message']

The type of the output item.

role pydantic-field

role: Literal['assistant']

The role of the message. Always 'assistant'.

content pydantic-field

content: list[OutputContentItem]

The content items of the message.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete']

The status of the message.

OutputText pydantic-model

Show JSON schema:
{
  "$defs": {
    "AnnotationContainerFileCitation": {
      "properties": {
        "container_id": {
          "description": "The ID of the container.",
          "title": "Container Id",
          "type": "string"
        },
        "end_index": {
          "description": "The index of the last character of the citation.",
          "title": "End Index",
          "type": "integer"
        },
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the container file cited.",
          "title": "Filename",
          "type": "string"
        },
        "start_index": {
          "description": "The index of the first character of the citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "type": {
          "const": "container_file_citation",
          "description": "Always 'container_file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "container_id",
        "end_index",
        "file_id",
        "filename",
        "start_index",
        "type"
      ],
      "title": "AnnotationContainerFileCitation",
      "type": "object"
    },
    "AnnotationFileCitation": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "description": "The filename of the file cited.",
          "title": "Filename",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_citation",
          "description": "Always 'file_citation'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "filename",
        "index",
        "type"
      ],
      "title": "AnnotationFileCitation",
      "type": "object"
    },
    "AnnotationFilePath": {
      "properties": {
        "file_id": {
          "description": "The ID of the file.",
          "title": "File Id",
          "type": "string"
        },
        "index": {
          "description": "The index of the file in the list of files.",
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "file_path",
          "description": "Always 'file_path'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "file_id",
        "index",
        "type"
      ],
      "title": "AnnotationFilePath",
      "type": "object"
    },
    "AnnotationURLCitation": {
      "properties": {
        "end_index": {
          "description": "The index of the last character of the URL citation.",
          "title": "End Index",
          "type": "integer"
        },
        "start_index": {
          "description": "The index of the first character of the URL citation.",
          "title": "Start Index",
          "type": "integer"
        },
        "title": {
          "description": "The title of the web resource.",
          "title": "Title",
          "type": "string"
        },
        "type": {
          "const": "url_citation",
          "description": "Always 'url_citation'.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "The URL of the web resource.",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "end_index",
        "start_index",
        "title",
        "type",
        "url"
      ],
      "title": "AnnotationURLCitation",
      "type": "object"
    },
    "OutputTextLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        },
        "top_logprobs": {
          "description": "List of the most likely tokens and their log probability.",
          "items": {
            "$ref": "#/$defs/OutputTextLogprobTopLogprob"
          },
          "title": "Top Logprobs",
          "type": "array"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob",
        "top_logprobs"
      ],
      "title": "OutputTextLogprob",
      "type": "object"
    },
    "OutputTextLogprobTopLogprob": {
      "properties": {
        "token": {
          "description": "The token.",
          "title": "Token",
          "type": "string"
        },
        "bytes": {
          "description": "A list of integers representing the UTF-8 bytes of the token.",
          "items": {
            "type": "integer"
          },
          "title": "Bytes",
          "type": "array"
        },
        "logprob": {
          "description": "The log probability of the token.",
          "title": "Logprob",
          "type": "number"
        }
      },
      "required": [
        "token",
        "bytes",
        "logprob"
      ],
      "title": "OutputTextLogprobTopLogprob",
      "type": "object"
    }
  },
  "properties": {
    "type": {
      "const": "output_text",
      "description": "The type of the output content.",
      "title": "Type",
      "type": "string"
    },
    "text": {
      "description": "The text content.",
      "title": "Text",
      "type": "string"
    },
    "annotations": {
      "description": "Annotations for the text.",
      "items": {
        "discriminator": {
          "mapping": {
            "container_file_citation": "#/$defs/AnnotationContainerFileCitation",
            "file_citation": "#/$defs/AnnotationFileCitation",
            "file_path": "#/$defs/AnnotationFilePath",
            "url_citation": "#/$defs/AnnotationURLCitation"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/AnnotationFileCitation"
          },
          {
            "$ref": "#/$defs/AnnotationURLCitation"
          },
          {
            "$ref": "#/$defs/AnnotationContainerFileCitation"
          },
          {
            "$ref": "#/$defs/AnnotationFilePath"
          }
        ]
      },
      "title": "Annotations",
      "type": "array"
    },
    "logprobs": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/OutputTextLogprob"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Log probability information.",
      "title": "Logprobs"
    }
  },
  "required": [
    "type",
    "text"
  ],
  "title": "OutputText",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['output_text']

The type of the output content.

text pydantic-field

text: str

The text content.

annotations pydantic-field

annotations: list[Annotation]

Annotations for the text.

logprobs pydantic-field

logprobs: list[OutputTextLogprob] | None = None

Log probability information.

Refusal pydantic-model

Show JSON schema:
{
  "properties": {
    "type": {
      "const": "refusal",
      "description": "The type of the output content.",
      "title": "Type",
      "type": "string"
    },
    "refusal": {
      "description": "The refusal message generated by the model.",
      "title": "Refusal",
      "type": "string"
    }
  },
  "required": [
    "type",
    "refusal"
  ],
  "title": "Refusal",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['refusal']

The type of the output content.

refusal pydantic-field

refusal: str

The refusal message generated by the model.

FunctionToolCall pydantic-model

Show JSON schema:
{
  "properties": {
    "type": {
      "const": "function_call",
      "description": "The type of the tool call.",
      "title": "Type",
      "type": "string"
    },
    "call_id": {
      "description": "The unique ID of the function tool call generated by the model.",
      "title": "Call Id",
      "type": "string"
    },
    "name": {
      "description": "The name of the function to call.",
      "title": "Name",
      "type": "string"
    },
    "arguments": {
      "description": "The arguments to call the function with, as a JSON string.",
      "title": "Arguments",
      "type": "string"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the function tool call.",
      "title": "Id"
    },
    "status": {
      "anyOf": [
        {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the tool call.",
      "title": "Status"
    }
  },
  "required": [
    "type",
    "call_id",
    "name",
    "arguments"
  ],
  "title": "FunctionToolCall",
  "type": "object"
}

Fields:

type pydantic-field

type: Literal['function_call']

The type of the tool call.

call_id pydantic-field

call_id: str

The unique ID of the function tool call generated by the model.

name pydantic-field

name: str

The name of the function to call.

arguments pydantic-field

arguments: str

The arguments to call the function with, as a JSON string.

id pydantic-field

id: str | None = None

The unique ID of the function tool call.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete'] | None = None

The status of the tool call.

ReasoningItem pydantic-model

Show JSON schema:
{
  "$defs": {
    "ReasoningContent": {
      "properties": {
        "text": {
          "description": "The reasoning text from the model.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "reasoning_text",
          "description": "Always 'reasoning_text'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ReasoningContent",
      "type": "object"
    },
    "ReasoningSummary": {
      "properties": {
        "text": {
          "description": "A summary of the reasoning output.",
          "title": "Text",
          "type": "string"
        },
        "type": {
          "const": "summary_text",
          "description": "Always 'summary_text'.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "text",
        "type"
      ],
      "title": "ReasoningSummary",
      "type": "object"
    }
  },
  "properties": {
    "id": {
      "description": "The unique identifier of the reasoning content.",
      "title": "Id",
      "type": "string"
    },
    "type": {
      "const": "reasoning",
      "description": "The type of the output item.",
      "title": "Type",
      "type": "string"
    },
    "summary": {
      "description": "Reasoning summary content.",
      "items": {
        "$ref": "#/$defs/ReasoningSummary"
      },
      "title": "Summary",
      "type": "array"
    },
    "content": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ReasoningContent"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reasoning text content.",
      "title": "Content"
    },
    "encrypted_content": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Encrypted content for multi-turn.",
      "title": "Encrypted Content"
    },
    "status": {
      "anyOf": [
        {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the reasoning item.",
      "title": "Status"
    }
  },
  "required": [
    "id",
    "type"
  ],
  "title": "ReasoningItem",
  "type": "object"
}

Fields:

id pydantic-field

id: str

The unique identifier of the reasoning content.

type pydantic-field

type: Literal['reasoning']

The type of the output item.

summary pydantic-field

summary: list[ReasoningSummary]

Reasoning summary content.

content pydantic-field

content: list[ReasoningContent] | None = None

Reasoning text content.

encrypted_content pydantic-field

encrypted_content: str | None = None

Encrypted content for multi-turn.

status pydantic-field

status: Literal['in_progress', 'completed', 'incomplete'] | None = None

The status of the reasoning item.

ResponseUsage pydantic-model

Show JSON schema:
{
  "$defs": {
    "InputTokensDetails": {
      "properties": {
        "cached_tokens": {
          "description": "The number of tokens that were retrieved from the cache.",
          "title": "Cached Tokens",
          "type": "integer"
        }
      },
      "required": [
        "cached_tokens"
      ],
      "title": "InputTokensDetails",
      "type": "object"
    },
    "OutputTokensDetails": {
      "properties": {
        "reasoning_tokens": {
          "description": "The number of reasoning tokens.",
          "title": "Reasoning Tokens",
          "type": "integer"
        }
      },
      "required": [
        "reasoning_tokens"
      ],
      "title": "OutputTokensDetails",
      "type": "object"
    }
  },
  "properties": {
    "input_tokens": {
      "description": "The number of input tokens.",
      "title": "Input Tokens",
      "type": "integer"
    },
    "input_tokens_details": {
      "$ref": "#/$defs/InputTokensDetails",
      "description": "A detailed breakdown of the input tokens."
    },
    "output_tokens": {
      "description": "The number of output tokens.",
      "title": "Output Tokens",
      "type": "integer"
    },
    "output_tokens_details": {
      "$ref": "#/$defs/OutputTokensDetails",
      "description": "A detailed breakdown of the output tokens."
    },
    "total_tokens": {
      "description": "The total number of tokens used.",
      "title": "Total Tokens",
      "type": "integer"
    }
  },
  "required": [
    "input_tokens",
    "input_tokens_details",
    "output_tokens",
    "output_tokens_details",
    "total_tokens"
  ],
  "title": "ResponseUsage",
  "type": "object"
}

Fields:

input_tokens pydantic-field

input_tokens: int

The number of input tokens.

input_tokens_details pydantic-field

input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

output_tokens pydantic-field

output_tokens: int

The number of output tokens.

output_tokens_details pydantic-field

output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

total_tokens pydantic-field

total_tokens: int

The total number of tokens used.

ResponseError pydantic-model

Show JSON schema:
{
  "properties": {
    "code": {
      "description": "The error code.",
      "title": "Code",
      "type": "string"
    },
    "message": {
      "description": "A human-readable error message.",
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "code",
    "message"
  ],
  "title": "ResponseError",
  "type": "object"
}

Fields:

code pydantic-field

code: str

The error code.

message pydantic-field

message: str

A human-readable error message.


Result Schema

When using Dual-LLM mode, the response content follows ResponseContentJsonSchema.

ResponseContentJsonSchema pydantic-model

Response content of a dual-LLM session.

Parses the content field of the assistant message returned by Sequrity Control in dual-LLM mode. The JSON looks like::

{
    "status": "success",
    "final_return_value": {"value": "...", "meta": {...}},
    "program": "...",
    ...
}

Use :meth:parse_json_safe for lenient parsing that never raises.

Show JSON schema:
{
  "$defs": {
    "ErrorInfo": {
      "description": "Represents error information in a dual-LLM response.\n\nWhen the server serialises an error for the user, it simplifies the\ninternal ``StateExecutionError`` into this flat structure.",
      "properties": {
        "code": {
          "title": "Code",
          "type": "string"
        },
        "message": {
          "title": "Message",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "ErrorInfo",
      "type": "object"
    },
    "MetaData": {
      "additionalProperties": false,
      "description": "Metadata associated with a value for Sequrity Control's policy enforcement system.\n\nEvery value flowing through the dual-LLM interpreter carries metadata that\nrecords *who* produced it, *who* may consume it, and arbitrary *tags* for\npolicy matching.",
      "properties": {
        "producers": {
          "items": {
            "type": "string"
          },
          "title": "Producers",
          "type": "array",
          "uniqueItems": true
        },
        "consumers": {
          "items": {
            "type": "string"
          },
          "title": "Consumers",
          "type": "array",
          "uniqueItems": true
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "title": "Tags",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "MetaData",
      "type": "object"
    },
    "ValueWithMeta": {
      "description": "Python value wrapper with metadata for Sequrity Control's policy enforcement system.",
      "properties": {
        "value": {
          "title": "Value"
        },
        "meta": {
          "$ref": "#/$defs/MetaData"
        }
      },
      "required": [
        "value"
      ],
      "title": "ValueWithMeta",
      "type": "object"
    }
  },
  "additionalProperties": true,
  "description": "Response content of a dual-LLM session.\n\nParses the ``content`` field of the assistant message returned by\nSequrity Control in dual-LLM mode.  The JSON looks like::\n\n    {\n        \"status\": \"success\",\n        \"final_return_value\": {\"value\": \"...\", \"meta\": {...}},\n        \"program\": \"...\",\n        ...\n    }\n\nUse :meth:`parse_json_safe` for lenient parsing that never raises.",
  "properties": {
    "status": {
      "enum": [
        "success",
        "failure",
        "unknown"
      ],
      "title": "Status",
      "type": "string"
    },
    "final_return_value": {
      "anyOf": [
        {
          "$ref": "#/$defs/ValueWithMeta"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorInfo"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "program": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Program"
    },
    "namespace_snapshot": {
      "anyOf": [
        {
          "additionalProperties": {
            "$ref": "#/$defs/ValueWithMeta"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Namespace Snapshot"
    },
    "session_meta": {
      "anyOf": [
        {
          "$ref": "#/$defs/ValueWithMeta"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "policy_check_history": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Policy Check History"
    },
    "message_history_mismatch_detected": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message History Mismatch Detected"
    },
    "raw": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Raw"
    }
  },
  "required": [
    "status"
  ],
  "title": "ResponseContentJsonSchema",
  "type": "object"
}

Config:

  • extra: allow

Fields:

parse_json_safe classmethod

parse_json_safe(data: str) -> ResponseContentJsonSchema

Parse JSON data safely, returning an unknown status if parsing fails.

Source code in src/sequrity/control/types/dual_llm_response.py
@classmethod
def parse_json_safe(cls, data: str) -> ResponseContentJsonSchema:
    """Parse JSON data safely, returning an ``unknown`` status if parsing fails."""
    try:
        validated = cls.model_validate_json(data)
    except Exception:
        validated = cls(status="unknown", raw=data)
    return validated

ErrorInfo pydantic-model

Represents error information in a dual-LLM response.

When the server serialises an error for the user, it simplifies the internal StateExecutionError into this flat structure.

Show JSON schema:
{
  "description": "Represents error information in a dual-LLM response.\n\nWhen the server serialises an error for the user, it simplifies the\ninternal ``StateExecutionError`` into this flat structure.",
  "properties": {
    "code": {
      "title": "Code",
      "type": "string"
    },
    "message": {
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "code",
    "message"
  ],
  "title": "ErrorInfo",
  "type": "object"
}

Fields: