> ## Documentation Index
> Fetch the complete documentation index at: https://concentrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions

> OpenAI Chat Completions API compatibility endpoint for Cursor, Opencode, and other clients

<Warning>
  **Beta Feature**

  The Chat Completions API is currently in beta. It provides OpenAI Chat Completions API compatibility for clients like Cursor, Opencode, and other tools that use the OpenAI format. For production use, we recommend using the [Responses API](/docs/api-reference/endpoint/create-response) instead.
</Warning>

## Overview

OpenAI Chat Completions API compatibility endpoint. Use Concentrate as a drop-in replacement for OpenAI in any tool or SDK that supports configurable base URLs.


## OpenAPI

````yaml POST /v1/chat/completions/
openapi: 3.0.3
info:
  title: Responses API
  description: Unified responses API
  version: 1.0.0
servers:
  - url: https://api.concentrate.ai
security: []
paths:
  /v1/chat/completions/:
    post:
      tags:
        - chat-completions
        - openai
      description: >-
        OpenAI Chat Completions API compatibility endpoint for Cursor, Opencode,
        and other clients
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messages:
                  minItems: 1
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - developer
                              - system
                            description: The role of the author of this message.
                          content:
                            anyOf:
                              - type: string
                              - type: array
                                items:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - text
                                      description: The type of content.
                                    text:
                                      type: string
                                      description: The text content.
                                    prompt_cache_breakpoint:
                                      allOf:
                                        - $ref: >-
                                            #/components/schemas/PromptCacheBreakpointInput
                                  required:
                                    - type
                                    - text
                            description: The contents of the system message.
                          name:
                            description: An optional name for the participant.
                            nullable: true
                            type: string
                        required:
                          - role
                          - content
                        title: System Message
                      - type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - user
                            description: The role of the author of this message.
                          content:
                            anyOf:
                              - type: string
                              - type: array
                                items:
                                  oneOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of content.
                                        text:
                                          type: string
                                          description: The text content.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - text
                                      title: Text
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - image_url
                                          description: The type of content.
                                        image_url:
                                          type: object
                                          properties:
                                            url:
                                              type: string
                                              description: The URL of the image.
                                          required:
                                            - url
                                          description: Image URL details.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - image_url
                                      title: Image URL
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - file
                                          description: The type of content.
                                        file:
                                          type: object
                                          properties:
                                            filename:
                                              description: The filename of the file.
                                              type: string
                                            file_data:
                                              description: The base64-encoded file data.
                                              type: string
                                            file_url:
                                              description: The URL of the file.
                                              type: string
                                            file_id:
                                              description: The ID of the file.
                                              type: string
                                          description: File details.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - file
                                      title: File
                            description: The contents of the user message.
                        required:
                          - role
                          - content
                        title: User Message
                      - type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - assistant
                            description: The role of the author of this message.
                          content:
                            description: The contents of the assistant message.
                            nullable: true
                            anyOf:
                              - type: string
                              - type: array
                                items:
                                  oneOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of content.
                                        text:
                                          type: string
                                          description: The text content.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - text
                                      title: Text
                          name:
                            description: An optional name for the participant.
                            nullable: true
                            type: string
                          refusal:
                            description: Refusals from the model are returned as refusal.
                            nullable: true
                            type: string
                          reasoning:
                            description: The reasoning content generated by the model.
                            nullable: true
                            type: string
                          reasoning_content:
                            description: >-
                              The reasoning content generated by the model.
                              Included for compatibility. Use `reasoning` over
                              `reasoning_content`.
                            nullable: true
                            type: string
                          tool_calls:
                            description: The tool calls generated by the model.
                            nullable: true
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - function
                                      description: The type of the tool call.
                                    id:
                                      type: string
                                      description: The ID of the tool call.
                                    function:
                                      type: object
                                      properties:
                                        name:
                                          description: The name of the function to call.
                                          type: string
                                          maxLength: 256
                                        arguments:
                                          type: string
                                          description: The arguments to pass to the function.
                                      required:
                                        - name
                                        - arguments
                                      description: The function that the model called.
                                  required:
                                    - type
                                    - id
                                    - function
                                  title: Function Tool Call
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - custom
                                      description: The type of the tool call.
                                    id:
                                      type: string
                                      description: The ID of the tool call.
                                    custom:
                                      type: object
                                      properties:
                                        input:
                                          type: string
                                          description: The input to pass to the custom tool.
                                        name:
                                          description: The name of the custom tool.
                                          type: string
                                          maxLength: 256
                                      required:
                                        - input
                                        - name
                                      description: The custom tool that the model called.
                                  required:
                                    - type
                                    - id
                                    - custom
                                  title: Custom Tool Call
                          function_call:
                            nullable: true
                            type: object
                            properties:
                              arguments:
                                type: string
                                description: The arguments passed to the function.
                              name:
                                description: The name of the function to call.
                                type: string
                                maxLength: 256
                            required:
                              - arguments
                              - name
                            description: Deprecated in favor of tool_calls.
                        required:
                          - role
                        title: Assistant Message
                      - type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - tool
                            description: The role of the author of this message.
                          content:
                            anyOf:
                              - type: string
                              - type: array
                                items:
                                  oneOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of content.
                                        text:
                                          type: string
                                          description: The text content.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - text
                                      title: Text
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - image_url
                                          description: The type of content.
                                        image_url:
                                          type: object
                                          properties:
                                            url:
                                              type: string
                                              description: The URL of the image.
                                          required:
                                            - url
                                          description: Image URL details.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - image_url
                                      title: Image URL
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - file
                                          description: The type of content.
                                        file:
                                          type: object
                                          properties:
                                            filename:
                                              description: The filename of the file.
                                              type: string
                                            file_data:
                                              description: The base64-encoded file data.
                                              type: string
                                            file_url:
                                              description: The URL of the file.
                                              type: string
                                            file_id:
                                              description: The ID of the file.
                                              type: string
                                          description: File details.
                                        prompt_cache_breakpoint:
                                          allOf:
                                            - $ref: >-
                                                #/components/schemas/PromptCacheBreakpointInput
                                      required:
                                        - type
                                        - file
                                      title: File
                            description: The contents of the tool message.
                          tool_call_id:
                            type: string
                            description: >-
                              The ID of the tool call this message is responding
                              to.
                        required:
                          - role
                          - content
                          - tool_call_id
                        title: Tool Message
                  description: A list of messages comprising the conversation so far.
                model:
                  description: >-
                    Model identifier. Use /v1/models to list all available
                    models. Supports canonical names (e.g. gpt-5.2,
                    claude-opus-4-6), aliases, and provider-prefixed formats
                    (e.g. openai/gpt-5.2). Use "auto" for automatic model
                    selection.
                  type: string
                frequency_penalty:
                  description: >-
                    Number between -2.0 and 2.0. Positive values penalize new
                    tokens based on their existing frequency in the text so far,
                    decreasing the model's likelihood to repeat the same line
                    verbatim.
                  nullable: true
                  type: number
                  minimum: -2
                  maximum: 2
                function_call:
                  description: >-
                    Deprecated in favor of the tool_calls parameter. Will be
                    converted to `tool_choice`. Using `tool_choice` will
                    overwrite this.
                  nullable: true
                  anyOf:
                    - type: string
                      enum:
                        - none
                        - auto
                    - type: object
                      properties:
                        name:
                          type: string
                          maxLength: 256
                          description: >-
                            The name. Must contain only alphanumeric characters,
                            underscores, dots, and hyphens, with a maximum
                            length of 256 characters, with a minimum length of 1
                            character after unaccepted characters are stripped.
                      required:
                        - name
                      additionalProperties: false
                      title: Function
                functions:
                  description: >-
                    Deprecated in favor of the tools parameter. Will be
                    converted to tools when used.
                  nullable: true
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        maxLength: 256
                        description: >-
                          The name. Must contain only alphanumeric characters,
                          underscores, dots, and hyphens, with a maximum length
                          of 256 characters, with a minimum length of 1
                          character after unaccepted characters are stripped.
                      description:
                        nullable: true
                        type: string
                      parameters:
                        type: object
                        additionalProperties: {}
                    required:
                      - name
                      - parameters
                    additionalProperties: false
                logit_bias:
                  description: >-
                    Unsupported. Modify the likelihood of specified tokens
                    appearing in the completion.
                  nullable: true
                  type: object
                  additionalProperties:
                    type: number
                    minimum: -100
                    maximum: 100
                logprobs:
                  description: >-
                    Whether to return log probabilities of the output tokens. If
                    true, logprobs will be included in the response.
                  nullable: true
                  type: boolean
                max_completion_tokens:
                  description: >-
                    The maximum number of tokens that can be generated in the
                    chat completion. The total length of input tokens and
                    generated tokens is limited by the model's context length.
                  nullable: true
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                max_tokens:
                  description: Deprecated, use max_completion_tokens instead.
                  nullable: true
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                metadata:
                  description: >-
                    Set of 16 key-value pairs that can be attached to an object.
                    This can be useful for storing additional information about
                    the object in a structured format.
                  nullable: true
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 512
                modalities:
                  description: >-
                    Unsupported. A list of modalities that the model supports.
                    The model will use these modalities when processing the
                    request.
                  nullable: true
                  minItems: 1
                  maxItems: 2
                  type: array
                  items:
                    type: string
                    enum:
                      - text
                      - audio
                'n':
                  description: >-
                    Unsupported. How many chat completion choices to generate
                    for each input message.
                  nullable: true
                  type: integer
                  minimum: 1
                  maximum: 128
                parallel_tool_calls:
                  description: Whether to enable parallel function calling during tool use.
                  nullable: true
                  type: boolean
                prediction:
                  description: >-
                    Unsupported. Specifies the model should predict a specified
                    content, then continue generating naturally.
                  nullable: true
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - content
                    content:
                      anyOf:
                        - type: string
                        - type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - text
                                description: The type of content.
                              text:
                                type: string
                                description: The text content.
                              prompt_cache_breakpoint:
                                allOf:
                                  - $ref: >-
                                      #/components/schemas/PromptCacheBreakpointInput
                            required:
                              - type
                              - text
                            additionalProperties: false
                  required:
                    - type
                    - content
                presence_penalty:
                  description: >-
                    Unsupported. Number between -2.0 and 2.0. Positive values
                    penalize new tokens based on whether they appear in the text
                    so far, increasing the model's likelihood to talk about new
                    topics.
                  nullable: true
                  type: number
                  minimum: -2
                  maximum: 2
                prompt_cache_key:
                  description: >-
                    Optional custom identifier for managing prompt cache
                    entries.
                  nullable: true
                  type: string
                prompt_cache_options:
                  nullable: true
                  allOf:
                    - $ref: '#/components/schemas/PromptCacheOptionsInput'
                prompt_cache_retention:
                  nullable: true
                  type: string
                  enum:
                    - in-memory
                    - in_memory
                    - 24h
                  description: >-
                    The legacy OpenAI prompt-cache retention policy. Earlier
                    OpenAI models use this field for in-memory or 24-hour
                    retention. GPT-5.6 and later use prompt_cache_options.ttl
                    instead.
                reasoning_effort:
                  nullable: true
                  type: string
                  enum:
                    - none
                    - minimal
                    - low
                    - medium
                    - high
                    - xhigh
                    - max
                  description: >-
                    Constrains effort on reasoning for reasoning models.
                    Reducing reasoning effort can result in faster responses and
                    fewer tokens used on reasoning in a response.

                    Not all models support all reasoning levels. If your
                    requested reasoning level isn't supported by the model,
                    Concentrate bumps it up, then down, to the closest reasoning
                    level.
                response_format:
                  description: An object specifying the format that the model must output.
                  nullable: true
                  oneOf:
                    - $ref: '#/components/schemas/TextFormatInput'
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - json_schema
                          description: The response format type.
                        json_schema:
                          type: object
                          properties:
                            name:
                              description: The name of the response schema.
                              type: string
                              maxLength: 256
                            description:
                              description: A description of the response schema.
                              nullable: true
                              type: string
                            strict:
                              description: Whether to enforce strict schema adherence.
                              nullable: true
                              type: boolean
                            schema:
                              type: object
                              additionalProperties: {}
                              description: The JSON schema for the response.
                          required:
                            - name
                            - schema
                          description: The JSON schema details.
                      required:
                        - type
                        - json_schema
                      title: JSON Schema Format
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - json_object
                          description: The response format type.
                      required:
                        - type
                      title: JSON Object Format
                safety_identifier:
                  description: >-
                    Unique identifier to help detect when content may violate
                    usage policies.
                  nullable: true
                  type: string
                seed:
                  description: >-
                    Unsupported. If specified, our system will make a best
                    effort to sample deterministically, such that repeated
                    requests with the same seed and parameters should return the
                    same result.
                  nullable: true
                  type: string
                service_tier:
                  description: Specifies which tier to use for processing the request.
                  nullable: true
                  type: string
                  enum:
                    - auto
                    - default
                    - flex
                    - scale
                    - priority
                stop:
                  description: >-
                    Unsupported. Up to 4 sequences where the API will stop
                    generating further tokens.
                  nullable: true
                  anyOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                store:
                  description: >-
                    If true, the model's response will be stored for reuse by
                    other requests.
                  nullable: true
                  type: boolean
                stream:
                  description: >-
                    If true, partial message deltas will be sent. Tokens will be
                    sent as data-only server-sent events as they become
                    available.
                  nullable: true
                  type: boolean
                stream_options:
                  nullable: true
                  type: object
                  properties:
                    include_obfuscation:
                      nullable: true
                      type: boolean
                      description: >-
                        When true, stream obfuscation will be enabled. Stream
                        obfuscation adds random characters to an obfuscation
                        field on streaming delta events to normalize payload
                        sizes as a mitigation to certain side-channel attacks.
                        These obfuscation fields are included by default, but
                        add a small amount of overhead to the data stream. You
                        can set include_obfuscation to false to optimize for
                        bandwidth if you trust the network links between your
                        application and the API.

                        Currently unsupported, but included for compatibility.
                    include_usage:
                      nullable: true
                      type: boolean
                temperature:
                  description: >-
                    What sampling temperature to use, between 0 and 2. Higher
                    values like 0.8 will make the output more random, while
                    lower values like 0.2 will make it more focused and
                    deterministic.
                  nullable: true
                  type: number
                  minimum: 0
                  maximum: 2
                tool_choice:
                  description: Controls which (if any) function is called by the model.
                  nullable: true
                  anyOf:
                    - type: string
                      enum:
                        - none
                        - auto
                        - required
                      description: >-
                        Controls which (if any) tool is called by the model.

                        none means the model will not call any tool.

                        auto means the model can pick between generating a
                        message or calling one or more tools.

                        required means the model must call one or more tools.
                      title: Tool Choice Mode
                    - oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - function
                              description: The type of tool choice.
                            function:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: The name of the function to require.
                              required:
                                - name
                              description: Function tool choice details.
                          required:
                            - type
                            - function
                          additionalProperties: false
                          title: Function
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - custom
                              description: The type of tool choice.
                            custom:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: The name of the custom tool to require.
                              required:
                                - name
                              description: Custom tool choice details.
                          required:
                            - type
                            - custom
                          additionalProperties: false
                          title: Custom
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - allowed_tools
                        allowed_tools:
                          type: object
                          properties:
                            mode:
                              type: string
                              enum:
                                - auto
                                - required
                            tools:
                              type: array
                              items:
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - function
                                        description: The type of the tool.
                                      function:
                                        type: object
                                        properties:
                                          name:
                                            description: The name of the function.
                                            type: string
                                            maxLength: 256
                                          description:
                                            description: A description of what the function does.
                                            nullable: true
                                            type: string
                                          parameters:
                                            description: The parameters the function accepts.
                                            nullable: true
                                            type: object
                                            additionalProperties: {}
                                          strict:
                                            description: >-
                                              Whether to enable strict schema
                                              adherence when generating function
                                              calls.
                                            nullable: true
                                            default: false
                                            type: boolean
                                        required:
                                          - name
                                        description: The function definition.
                                    required:
                                      - type
                                      - function
                                    additionalProperties: false
                                    title: Function Tool
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - custom
                                        description: The type of the tool.
                                      custom:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                            description: The name of the custom tool.
                                          description:
                                            description: >-
                                              A description of what the custom tool
                                              does.
                                            nullable: true
                                            type: string
                                          format:
                                            description: >-
                                              The format specification for the custom
                                              tool.
                                            nullable: true
                                            oneOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - text
                                                required:
                                                  - type
                                                additionalProperties: false
                                                title: Text Format
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - grammar
                                                  grammar:
                                                    type: object
                                                    properties:
                                                      syntax:
                                                        type: string
                                                        enum:
                                                          - lark
                                                          - regex
                                                      definition:
                                                        type: string
                                                    required:
                                                      - syntax
                                                      - definition
                                                required:
                                                  - type
                                                  - grammar
                                                additionalProperties: false
                                                title: Grammar Format
                                        required:
                                          - name
                                        description: The custom tool definition.
                                    required:
                                      - type
                                      - custom
                                    additionalProperties: false
                                    title: Custom Tool
                          required:
                            - mode
                            - tools
                      required:
                        - type
                        - allowed_tools
                      title: Allowed Tools
                tools:
                  description: A list of tools the model may call.
                  nullable: true
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - function
                            description: The type of the tool.
                          function:
                            type: object
                            properties:
                              name:
                                description: The name of the function.
                                type: string
                                maxLength: 256
                              description:
                                description: A description of what the function does.
                                nullable: true
                                type: string
                              parameters:
                                description: The parameters the function accepts.
                                nullable: true
                                type: object
                                additionalProperties: {}
                              strict:
                                description: >-
                                  Whether to enable strict schema adherence when
                                  generating function calls.
                                nullable: true
                                default: false
                                type: boolean
                            required:
                              - name
                            description: The function definition.
                        required:
                          - type
                          - function
                        additionalProperties: false
                        title: Function Tool
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - custom
                            description: The type of the tool.
                          custom:
                            type: object
                            properties:
                              name:
                                type: string
                                description: The name of the custom tool.
                              description:
                                description: A description of what the custom tool does.
                                nullable: true
                                type: string
                              format:
                                description: The format specification for the custom tool.
                                nullable: true
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - text
                                    required:
                                      - type
                                    additionalProperties: false
                                    title: Text Format
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - grammar
                                      grammar:
                                        type: object
                                        properties:
                                          syntax:
                                            type: string
                                            enum:
                                              - lark
                                              - regex
                                          definition:
                                            type: string
                                        required:
                                          - syntax
                                          - definition
                                    required:
                                      - type
                                      - grammar
                                    additionalProperties: false
                                    title: Grammar Format
                            required:
                              - name
                            description: The custom tool definition.
                        required:
                          - type
                          - custom
                        additionalProperties: false
                        title: Custom Tool
                top_logprobs:
                  nullable: true
                  type: integer
                  minimum: 0
                  maximum: 20
                  description: >-
                    An integer between 0 and 20 specifying the number of most
                    likely tokens to return at each token position, each with an
                    associated log probability.
                top_p:
                  description: >-
                    An alternative to sampling with temperature, called nucleus
                    sampling, where the model considers the results of the
                    tokens with top_p probability mass.
                  nullable: true
                  type: number
                  minimum: 0
                  maximum: 1
                user:
                  description: >-
                    A unique identifier representing your end-user, which can
                    help OpenAI to monitor and detect abuse.
                  nullable: true
                  type: string
                verbosity:
                  nullable: true
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                  description: >-
                    Constrains the verbosity of the model's response. Lower
                    values will result in more concise responses, while higher
                    values will result in more verbose responses. Currently
                    supported values are low, medium, and high.
                web_search_options:
                  description: Options for web search integration.
                  nullable: true
                  type: object
                  properties:
                    search_context_size:
                      description: >-
                        The amount of context to retrieve from web search
                        results.
                      nullable: true
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                    user_location:
                      nullable: true
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - approximate
                          description: The location type.
                        approximate:
                          type: object
                          properties:
                            timezone:
                              type: string
                              nullable: true
                              description: >-
                                IANA timezone identifier (e.g. America/New_York,
                                Europe/London, Asia/Tokyo).
                            country:
                              type: string
                              nullable: true
                              description: >-
                                ISO 3166-1 alpha-2 country code (e.g. US, GB,
                                DE, JP).
                            city:
                              type: string
                              description: >-
                                Free text input for the city of the user, e.g.
                                San Francisco.
                              nullable: true
                            region:
                              type: string
                              description: >-
                                Free text input for the region of the user, e.g.
                                California.
                              nullable: true
                          description: Approximate location details.
                      required:
                        - type
                        - approximate
                      description: User location for web search.
                routing:
                  nullable: true
                  type: object
                  properties:
                    model:
                      nullable: true
                      type: object
                      properties:
                        fallbacks:
                          nullable: true
                          type: array
                          items:
                            description: One of 4631 allowed values.
                            type: string
                          description: >-
                            Ordered list of models to fall back to if the
                            primary model is unavailable or fails.

                            Using auto in the fallbacks will move it to the end
                            of the fallback list, and can be used to
                            continuously try models until one succeeds.
                        sort:
                          nullable: true
                          default: performance
                          description: >-
                            The metric used to sort and select among routing
                            candidates, such as cost, performance, or a
                            percentile latency metric (e.g. p95_latency).
                            Defaults to performance.

                            All metrics are cached for the most recent 15
                            minutes (except percentile latencies other than p50,
                            p90, and p99).
                          anyOf:
                            - type: string
                              enum:
                                - cost
                                - performance
                                - total_requests
                                - uptime
                                - throughput
                                - avg_latency
                                - latency
                                - avg_e2e_latency
                                - e2e_latency
                                - input_tokens
                                - output_tokens
                                - total_tokens
                            - type: string
                              pattern: ^p([0-9]|[1-9][0-9]|100)_(latency|e2e_latency)$
                      description: Model-level routing configuration.
                    provider:
                      nullable: true
                      type: object
                      properties:
                        fallbacks:
                          nullable: true
                          type: array
                          items:
                            type: string
                            description: One of 65 allowed values.
                          description: >-
                            Ordered list of providers to fall back to if the
                            primary provider is unavailable or fails.
                        sort:
                          nullable: true
                          default: performance
                          description: >-
                            The metric used to sort and select among routing
                            candidates, such as cost, performance, or a
                            percentile latency metric (e.g. p95_latency).
                            Defaults to performance.

                            All metrics are cached for the most recent 15
                            minutes (except percentile latencies other than p50,
                            p90, and p99).
                          anyOf:
                            - type: string
                              enum:
                                - cost
                                - performance
                                - total_requests
                                - uptime
                                - throughput
                                - avg_latency
                                - latency
                                - avg_e2e_latency
                                - e2e_latency
                                - input_tokens
                                - output_tokens
                                - total_tokens
                            - type: string
                              pattern: ^p([0-9]|[1-9][0-9]|100)_(latency|e2e_latency)$
                        interval:
                          nullable: true
                          description: >-
                            The time window over which routing metrics are
                            evaluated. Can be written as '1h' or '1 hour'.
                            Defaults to 15 minutes.

                            All metrics are cached for the most recent 15
                            minutes (except percentile latencies other than p50,
                            p90, and p99). Any historical metrics longer than 15
                            minutes are then cached for 15 minutes upon request,
                            and are refreshed when you use those metrics again.
                          type: string
                          pattern: >-
                            ^\d+(?:m| minutes|h| hours?|d| days?|w| weeks?|y|
                            years?)$
                      description: Provider-level routing configuration.
                  description: >-
                    Concentrate routing configuration controlling how requests
                    are routed across models and providers. Learn more about
                    routing.
              required:
                - messages
                - model
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  model:
                    type: string
                    description: The model used for the chat completion.
                  created:
                    type: number
                    minimum: 0
                    description: >-
                      The Unix timestamp (in seconds) of when the chat
                      completion was created.
                  object:
                    type: string
                    description: >-
                      The object type, which is always 'chat.completion' or
                      'chat.completion.chunk'.
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: number
                          minimum: 0
                          description: The index of the choice in the list of choices.
                        logprobs:
                          nullable: true
                          type: object
                          properties:
                            content:
                              default: []
                              description: >-
                                Log probability information for the tokens in
                                the response.
                              type: array
                              items:
                                type: object
                                properties:
                                  token:
                                    type: string
                                  bytes:
                                    type: array
                                    items:
                                      type: number
                                  logprob:
                                    type: number
                                  top_logprobs:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        token:
                                          type: string
                                        bytes:
                                          type: array
                                          items:
                                            type: number
                                        logprob:
                                          type: number
                                      required:
                                        - token
                                        - bytes
                                        - logprob
                                      additionalProperties: false
                                required:
                                  - token
                                  - bytes
                                  - logprob
                                  - top_logprobs
                                additionalProperties: false
                            refusal:
                              default: []
                              description: >-
                                Log probability information for tokens that were
                                filtered or refusal tokens.
                              type: array
                              items:
                                type: object
                                properties:
                                  token:
                                    type: string
                                  bytes:
                                    type: array
                                    items:
                                      type: number
                                  logprob:
                                    type: number
                                  top_logprobs:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        token:
                                          type: string
                                        bytes:
                                          type: array
                                          items:
                                            type: number
                                        logprob:
                                          type: number
                                      required:
                                        - token
                                        - bytes
                                        - logprob
                                      additionalProperties: false
                                required:
                                  - token
                                  - bytes
                                  - logprob
                                  - top_logprobs
                                additionalProperties: false
                          required:
                            - content
                            - refusal
                          additionalProperties: false
                          description: Log probability information, if requested.
                        finish_reason:
                          type: string
                          enum:
                            - content_filter
                            - function_call
                            - length
                            - stop
                            - tool_calls
                          description: The reason the model stopped generating tokens.
                        message:
                          type: object
                          properties:
                            role:
                              type: string
                              enum:
                                - assistant
                              description: The role of the author of this message.
                            content:
                              nullable: true
                              description: The contents of the message.
                              type: string
                            reasoning:
                              description: The reasoning content generated by the model.
                              nullable: true
                              type: string
                            reasoning_content:
                              description: >-
                                The reasoning content generated by the model.
                                Included for compatibility. `reasoning` will be
                                returned rather than `reasoning_content`.
                              nullable: true
                              type: string
                            tool_calls:
                              description: Tool calls generated by the model, if any.
                              nullable: true
                              type: array
                              items:
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - function
                                        description: The type of the tool call.
                                      id:
                                        type: string
                                        description: The ID of the tool call.
                                      function:
                                        type: object
                                        properties:
                                          name:
                                            description: The name of the function to call.
                                          arguments:
                                            type: string
                                            description: The arguments to pass to the function.
                                        required:
                                          - name
                                          - arguments
                                        additionalProperties: false
                                        description: The function that the model called.
                                    required:
                                      - type
                                      - id
                                      - function
                                    additionalProperties: false
                                    title: Function Tool Call
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - custom
                                        description: The type of the tool call.
                                      id:
                                        type: string
                                        description: The ID of the tool call.
                                      custom:
                                        type: object
                                        properties:
                                          input:
                                            type: string
                                            description: The input to pass to the custom tool.
                                          name:
                                            description: The name of the custom tool.
                                        required:
                                          - input
                                          - name
                                        additionalProperties: false
                                        description: The custom tool that the model called.
                                    required:
                                      - type
                                      - id
                                      - custom
                                    additionalProperties: false
                                    title: Custom Tool Call
                            annotations:
                              description: Annotations for the message content.
                              nullable: true
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - url_citation
                                    description: The type of annotation.
                                  url_citation:
                                    type: object
                                    properties:
                                      url:
                                        type: string
                                        description: The URL being cited.
                                      title:
                                        type: string
                                        description: The title of the cited content.
                                      start_index:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          The start index of the citation in the
                                          content.
                                      end_index:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          The end index of the citation in the
                                          content.
                                    required:
                                      - url
                                      - title
                                      - start_index
                                      - end_index
                                    additionalProperties: false
                                    description: The URL citation details.
                                required:
                                  - type
                                  - url_citation
                                additionalProperties: false
                          required:
                            - role
                            - content
                          additionalProperties: false
                          description: A chat completion message generated by the model.
                      required:
                        - index
                        - finish_reason
                        - message
                      additionalProperties: false
                    description: >-
                      A list of chat completion choices. Can contain more than
                      one if n is greater than 1.
                  metadata:
                    description: >-
                      Set of 16 key-value pairs that can be attached to an
                      object. This can be useful for storing additional
                      information about the object in a structured format.
                    nullable: true
                    type: object
                    additionalProperties:
                      type: string
                      maxLength: 512
                  service_tier:
                    nullable: true
                    type: string
                    enum:
                      - auto
                      - default
                      - flex
                      - scale
                      - priority
                    description: >-
                      Specifies the processing type used for serving the
                      request. Determines the pricing and performance tier used
                      to process the request. When not set, the default behavior
                      is auto. Currently unsupported, but included for
                      compatibility.
                  usage:
                    type: object
                    properties:
                      completion_tokens:
                        description: Number of tokens in the generated completion.
                        type: number
                        minimum: 0
                      prompt_tokens:
                        description: Number of tokens in the prompt.
                        type: number
                        minimum: 0
                      total_tokens:
                        description: >-
                          Total number of tokens used in the request (prompt +
                          completion).
                        type: number
                        minimum: 0
                      prompt_tokens_details:
                        type: object
                        properties:
                          audio_tokens:
                            description: Audio tokens in the prompt.
                            type: number
                            minimum: 0
                          cached_tokens:
                            type: number
                            minimum: 0
                            description: Number of tokens in the prompt that were cached.
                          cache_write_tokens:
                            description: >-
                              Number of tokens in the prompt that were written
                              to cache.
                            type: number
                            minimum: 0
                        required:
                          - cached_tokens
                        additionalProperties: false
                        description: Breakdown of prompt tokens.
                      completion_tokens_details:
                        nullable: true
                        type: object
                        properties:
                          accepted_prediction_tokens:
                            description: >-
                              Number of tokens accepted from the prediction
                              input.
                            type: number
                            minimum: 0
                          audio_tokens:
                            description: Audio tokens in the completion.
                            type: number
                            minimum: 0
                          reasoning_tokens:
                            type: number
                            minimum: 0
                            description: Number of tokens used for reasoning.
                          rejected_prediction_tokens:
                            description: >-
                              Number of tokens from the prediction input that
                              were rejected.
                            type: number
                            minimum: 0
                        required:
                          - reasoning_tokens
                        additionalProperties: false
                        description: Breakdown of completion tokens.
                    additionalProperties: false
                    description: Usage statistics for the completion request.
                  cost:
                    type: object
                    properties:
                      total:
                        type: number
                      byok:
                        type: boolean
                        description: >-
                          Whether the request was served using one of your BYOK
                          provider keys.
                      breakdown:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            input_tokens:
                              type: number
                              minimum: 0
                            input_tokens_details:
                              type: object
                              properties:
                                cached_tokens:
                                  type: number
                                  minimum: 0
                                  description: >-
                                    The number of input tokens read from the
                                    prompt cache.
                                cached_tokens_created:
                                  nullable: true
                                  type: number
                                  minimum: 0
                                  description: >-
                                    Deprecated: use cache_write_tokens instead.
                                    The number of input tokens written to the
                                    prompt cache. Still populated for now, but
                                    will be removed in a future release.
                                  deprecated: true
                                cache_write_tokens:
                                  nullable: true
                                  type: number
                                  minimum: 0
                                  description: >-
                                    The number of input tokens written to the
                                    prompt cache.
                              required:
                                - cached_tokens
                              additionalProperties: false
                            output_tokens:
                              type: number
                              minimum: 0
                            output_tokens_details:
                              type: object
                              properties:
                                reasoning_tokens:
                                  type: number
                                  minimum: 0
                              required:
                                - reasoning_tokens
                              additionalProperties: false
                            tool_calls:
                              nullable: true
                              type: object
                              properties:
                                web_search:
                                  nullable: true
                                  type: number
                                  minimum: 0
                                exa_web_search:
                                  nullable: true
                                  type: number
                                  minimum: 0
                              additionalProperties: false
                            total_tokens:
                              type: number
                              minimum: 0
                          required:
                            - input_tokens
                            - input_tokens_details
                            - output_tokens
                            - output_tokens_details
                            - total_tokens
                          additionalProperties: false
                    required:
                      - total
                      - byok
                      - breakdown
                    additionalProperties: false
                    description: The cost of the completion request.
                  redact:
                    nullable: true
                    type: object
                    properties:
                      entities_found:
                        type: number
                      entity_types:
                        type: array
                        items:
                          type: string
                      models_used:
                        type: array
                        items:
                          type: string
                      execution_time_ms:
                        type: number
                      redaction_coverage:
                        type: number
                      redacted_input:
                        type: array
                        items:
                          $ref: '#/components/schemas/InputItem'
                      redacted_tools:
                        type: array
                        items:
                          $ref: '#/components/schemas/Tool'
                    additionalProperties: false
                required:
                  - id
                  - model
                  - created
                  - object
                  - choices
                  - usage
                  - cost
                additionalProperties: false
        default:
          description: Default Response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            description: One of 25 allowed values.
                          message:
                            type: string
                          upstream_error:
                            type: string
                            description: >-
                              The raw JSON error payload returned by the
                              upstream provider, present when the error
                              originated there
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
components:
  schemas:
    PromptCacheBreakpointInput:
      type: object
      properties:
        mode:
          type: string
          description: Creates an explicit prompt-cache breakpoint after this block.
          enum:
            - explicit
      required:
        - mode
      description: OpenAI explicit prompt-cache breakpoint settings.
    PromptCacheOptionsInput:
      type: object
      properties:
        mode:
          type: string
          enum:
            - implicit
            - explicit
          description: >-
            The prompt-caching mode. Explicit mode writes only at declared
            breakpoints.
        ttl:
          type: string
          enum:
            - 5m
            - 30m
            - 1h
          description: >-
            The minimum lifetime of cached prefixes written by this request.
            OpenAI supports 30m natively; 5m and 1h are accepted for
            cross-provider compatibility and snap to the nearest TTL the routed
            provider supports. Providers may retain cached prefixes longer.
      description: OpenAI prompt-cache behavior for this request.
    TextFormatInput:
      type: object
      properties:
        type:
          type: string
          description: The type of the format. Always text.
          enum:
            - text
      required:
        - type
      title: Text Format
      description: Default response format. Used to generate text responses.
    InputItem:
      anyOf:
        - $ref: '#/components/schemas/InputMessage'
        - $ref: '#/components/schemas/Item'
      description: 'A single input item: a message or an item.'
    Tool:
      oneOf:
        - $ref: '#/components/schemas/FunctionTool'
        - $ref: '#/components/schemas/WebSearchTool'
        - $ref: '#/components/schemas/CustomTool'
      description: A tool the model may call while generating a response.
    InputMessage:
      type: object
      properties:
        type:
          default: message
          description: The type of the input item. Always message.
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - developer
          description: The role of the message author.
        content:
          anyOf:
            - type: string
              minLength: 1
            - type: array
              items:
                $ref: '#/components/schemas/InputItemContent'
          description: 'The content of the message: a string, or an array of content parts.'
        phase:
          type: string
          enum:
            - commentary
            - final_answer
          nullable: true
      required:
        - role
        - content
      additionalProperties: false
      title: Message
      description: A message input to the model.
    Item:
      anyOf:
        - $ref: '#/components/schemas/InputMessageItem'
        - $ref: '#/components/schemas/OutputMessageItem'
        - $ref: '#/components/schemas/FunctionToolCallItem'
        - $ref: '#/components/schemas/FunctionToolCallOutputItem'
        - $ref: '#/components/schemas/CustomToolCallItem'
        - $ref: '#/components/schemas/CustomToolCallOutputItem'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/WebSearchToolCallItem'
        - $ref: '#/components/schemas/CompactionItem'
      description: A single item in the model's input or output.
    FunctionTool:
      type: object
      properties:
        type:
          type: string
          description: The type of the tool. Always function.
          enum:
            - function
        name: {}
        description:
          type: string
          description: >-
            A description of the function. Used by the model to determine
            whether or not to call the function.
          nullable: true
        parameters:
          type: object
          additionalProperties: {}
          description: A JSON schema object describing the parameters of the function.
        strict:
          type: boolean
          description: Whether to enforce strict parameter validation.
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
        - name
        - parameters
      additionalProperties: false
      title: Function Tool
      description: Defines a function in your own code the model can choose to call.
    WebSearchTool:
      type: object
      properties:
        type:
          type: string
          enum:
            - web_search
            - web_search_2025_08_26
            - web_search_preview
            - web_search_preview_2025_03_11
          description: The type of the web search tool.
        engine:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - auto
                    - native
              required:
                - type
              additionalProperties: false
              title: Auto / Native
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - exa
              required:
                - type
              additionalProperties: false
              title: Exa
          nullable: true
        filters:
          type: object
          properties:
            allowed_domains:
              minItems: 1
              maxItems: 1200
              type: array
              items:
                type: string
              description: >-
                Allowed domains for the search. If not provided, all domains are
                allowed.
              nullable: true
            blocked_domains:
              minItems: 1
              maxItems: 1200
              type: array
              items:
                type: string
              description: >-
                Blocked domains for the search. If not provided, all domains are
                allowed.
              nullable: true
          additionalProperties: false
          description: Filters applied to the web search.
          nullable: true
        search_context_size:
          type: string
          enum:
            - low
            - medium
            - high
          description: >-
            High level guidance for the amount of context window space to use
            for the search. One of low, medium, or high.
          nullable: true
        user_location:
          allOf:
            - $ref: '#/components/schemas/UserLocation'
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
      additionalProperties: false
      title: Web Search Tool
      description: Search the web for the latest information before generating a response.
    CustomTool:
      type: object
      properties:
        type:
          type: string
          description: The type of the tool. Always custom.
          enum:
            - custom
        name: {}
        description:
          type: string
          description: >-
            Optional description of the custom tool, used to provide more
            context.
          nullable: true
        format:
          allOf:
            - $ref: '#/components/schemas/CustomToolFormat'
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
        - name
      additionalProperties: false
      title: Custom Tool
      description: A custom tool that processes input using a specified format.
    InputItemContent:
      oneOf:
        - $ref: '#/components/schemas/InputText'
        - $ref: '#/components/schemas/InputImage'
        - $ref: '#/components/schemas/InputFile'
      description: 'A single piece of content in an input message: text, image, or file.'
    InputMessageItem:
      type: object
      properties:
        type:
          default: message
          description: The type of the item. Always message.
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - user
            - system
            - developer
          description: The role of the message author.
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
        content:
          type: array
          items:
            $ref: '#/components/schemas/InputItemContent'
          description: The content parts of the message.
      required:
        - role
        - content
      additionalProperties: false
      title: Input Message
      description: A message item in the model's input.
    OutputMessageItem:
      type: object
      properties:
        type:
          default: message
          description: The type of the item. Always message.
          type: string
          enum:
            - message
        role:
          type: string
          description: The role of the message author. Always assistant.
          enum:
            - assistant
        id:
          type: string
          description: The unique ID of the output message.
          nullable: true
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
        content:
          type: array
          items:
            $ref: '#/components/schemas/OutputItemContent'
          description: The content parts of the message.
        cache_control:
          $ref: '#/components/schemas/CacheControl'
        phase:
          type: string
          enum:
            - commentary
            - final_answer
          nullable: true
      required:
        - role
        - content
      additionalProperties: false
      title: Output Message
      description: A message item produced by the model.
    FunctionToolCallItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always function_call.
          enum:
            - function_call
        call_id:
          type: string
          description: >-
            The unique ID of the function tool call, used to correlate it with
            its output.
        name: {}
        arguments:
          type: string
          description: A JSON string of the arguments to pass to the function.
        id:
          type: string
          description: The unique ID of the function tool call item.
          nullable: true
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
        - call_id
        - name
        - arguments
      additionalProperties: false
      title: Function Tool Call
      description: A tool call to a function generated by the model.
    FunctionToolCallOutputItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always function_call_output.
          enum:
            - function_call_output
        call_id:
          type: string
          minLength: 1
          description: The unique ID of the function tool call this output is for.
        output:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/InputItemContent'
          description: The output of the function tool call.
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: The unique ID of the function tool call output item.
          nullable: true
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
        - call_id
        - output
      additionalProperties: false
      title: Function Tool Call Output
      description: The output of a function tool call, provided back to the model.
    CustomToolCallItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always custom_tool_call.
          enum:
            - custom_tool_call
        call_id:
          type: string
          description: >-
            The unique ID of the custom tool call, used to correlate it with its
            output.
        name: {}
        input:
          type: string
          description: The input passed to the custom tool.
        id:
          type: string
          description: The unique ID of the custom tool call item.
          nullable: true
      required:
        - type
        - call_id
        - name
        - input
      additionalProperties: false
      title: Custom Tool Call
      description: A call to a custom tool generated by the model.
    CustomToolCallOutputItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always custom_tool_call_output.
          enum:
            - custom_tool_call_output
        call_id:
          type: string
          description: The unique ID of the custom tool call this output is for.
        output:
          type: string
          description: The output of the custom tool call.
        id:
          type: string
          description: The unique ID of the custom tool call output item.
          nullable: true
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
      required:
        - type
        - call_id
        - output
      additionalProperties: false
      title: Custom Tool Call Output
      description: The output of a custom tool call, provided back to the model.
    ReasoningItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always reasoning.
          enum:
            - reasoning
        id:
          type: string
          description: The unique ID of the reasoning item.
          nullable: true
        summary:
          type: array
          items:
            $ref: '#/components/schemas/SummaryText'
          description: A summary of the reasoning performed by the model.
        content:
          type: array
          items:
            $ref: '#/components/schemas/ReasoningText'
          description: The reasoning text produced by the model.
          nullable: true
        encrypted_content:
          type: string
          description: >-
            The encrypted reasoning content, returned when reasoning is not
            stored.
          nullable: true
        status:
          type: string
          enum:
            - completed
            - in_progress
            - incomplete
          description: >-
            The status of the item. One of in_progress, completed, or
            incomplete.
          nullable: true
      required:
        - type
        - summary
      additionalProperties: false
      title: Reasoning
      description: A reasoning item produced by the model.
    WebSearchToolCallItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always web_search_call.
          enum:
            - web_search_call
        id:
          type: string
          description: The unique ID of the web search tool call.
        action:
          $ref: '#/components/schemas/WebSearchToolCallAction'
        status:
          anyOf:
            - type: string
              enum:
                - completed
                - in_progress
                - incomplete
              description: >-
                The status of the item. One of in_progress, completed, or
                incomplete.
            - type: string
              enum:
                - searching
          description: The status of the web search tool call.
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
      required:
        - type
        - id
      additionalProperties: false
      title: Web Search Tool Call
      description: A web search call generated by the model.
    CompactionItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the item. Always compaction.
          enum:
            - compaction
        id:
          type: string
          description: The unique ID of the compaction item.
          nullable: true
        encrypted_content:
          type: string
          maxLength: 10485760
          description: The encrypted compacted conversation context.
      required:
        - type
        - encrypted_content
      additionalProperties: false
      title: Compaction
      description: A compaction item containing compacted conversation context.
    CacheControl:
      type: object
      properties:
        type:
          default: ephemeral
          description: The cache control type. Currently only ephemeral is supported.
          type: string
          enum:
            - ephemeral
        ttl:
          default: 5m
          description: >-
            The time-to-live for the cache entry. One of 5m or 1h. Defaults to
            5m.
          type: string
          enum:
            - 5m
            - 1h
      required:
        - type
      additionalProperties: false
      description: Cache control settings for explicit prompt caching of this content.
    UserLocation:
      type: object
      properties:
        type:
          type: string
          description: The type of location approximation. Always approximate.
          enum:
            - approximate
        timezone:
          type: string
          nullable: true
          description: >-
            IANA timezone identifier (e.g. America/New_York, Europe/London,
            Asia/Tokyo).
        country:
          type: string
          nullable: true
          description: ISO 3166-1 alpha-2 country code (e.g. US, GB, DE, JP).
        city:
          type: string
          description: Free text input for the city of the user, e.g. San Francisco.
          nullable: true
        region:
          type: string
          description: Free text input for the region of the user, e.g. California.
          nullable: true
      required:
        - type
      additionalProperties: false
      description: The approximate location of the user, used to refine web search results.
    CustomToolFormat:
      oneOf:
        - $ref: '#/components/schemas/TextFormat'
        - $ref: '#/components/schemas/GrammarFormat'
      description: >-
        The input format for a custom tool. Either unconstrained text or a
        grammar.
    InputText:
      type: object
      properties:
        type:
          type: string
          description: The type of the input item. Always input_text.
          enum:
            - input_text
        text:
          type: string
          minLength: 1
          description: The text input to the model.
        cache_control:
          $ref: '#/components/schemas/CacheControl'
        prompt_cache_breakpoint:
          $ref: '#/components/schemas/PromptCacheBreakpoint'
      required:
        - type
        - text
      additionalProperties: false
      title: Input Text
      description: A text input to the model.
    InputImage:
      type: object
      properties:
        type:
          type: string
          description: The type of the input item. Always input_image.
          enum:
            - input_image
        image_url:
          type: string
          pattern: >-
            ^(https?:\/\/.+|data:image\/(png|jpe?g|webp|gif);base64,[A-Za-z0-9+/]+={0,2})$
          description: >-
            The URL of the image. Either an http(s) URL or a base64-encoded data
            URL (data:image/<type>;base64,...).
        detail:
          default: auto
          description: >-
            The detail level of the image to send to the model. One of low,
            high, auto, or original. Models that don't support 'original'
            convert it to 'high'.
          type: string
          enum:
            - low
            - high
            - auto
            - original
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
        prompt_cache_breakpoint:
          $ref: '#/components/schemas/PromptCacheBreakpoint'
      required:
        - type
        - image_url
      additionalProperties: false
      title: Input Image
      description: An image input to the model.
    InputFile:
      type: object
      properties:
        type:
          type: string
          description: The type of the input item. Always input_file.
          enum:
            - input_file
        file_data:
          type: string
          pattern: ^(data:application\/pdf;base64,)
          description: >-
            The content of the file as a base64-encoded PDF data URL
            (data:application/pdf;base64,...).
        file_url:
          type: string
          pattern: ^https?:\/\/
          description: The URL of the file to send to the model.
        filename:
          type: string
          description: The name of the file, only provided with file_url.
        cache_control:
          $ref: '#/components/schemas/CacheControl'
        prompt_cache_breakpoint:
          $ref: '#/components/schemas/PromptCacheBreakpoint'
      required:
        - type
      additionalProperties: false
      title: Input File
      description: A file input (PDF) to the model.
    OutputItemContent:
      oneOf:
        - $ref: '#/components/schemas/OutputText'
      description: A single piece of content in an output message.
    SummaryText:
      type: object
      properties:
        type:
          type: string
          description: The type of the content. Always summary_text.
          enum:
            - summary_text
        text:
          type: string
          description: The summarized reasoning text.
      required:
        - type
        - text
      additionalProperties: false
      description: A chunk of summarized reasoning text produced by the model.
    ReasoningText:
      type: object
      properties:
        type:
          type: string
          description: The type of the content. Always reasoning_text.
          enum:
            - reasoning_text
        text:
          type: string
          description: The reasoning text produced by the model.
      required:
        - type
        - text
      additionalProperties: false
      description: A chunk of reasoning text produced by the model.
    WebSearchToolCallAction:
      oneOf:
        - $ref: '#/components/schemas/WebSearchToolCallSearchAction'
        - $ref: '#/components/schemas/WebSearchToolCallOpenPageAction'
        - $ref: '#/components/schemas/WebSearchToolCallFindAction'
      description: An action performed by the web search tool.
    TextFormat:
      type: object
      properties:
        type:
          type: string
          description: The type of the format. Always text.
          enum:
            - text
      required:
        - type
      additionalProperties: false
      title: Text Format
      description: Default response format. Used to generate text responses.
    GrammarFormat:
      type: object
      properties:
        type:
          type: string
          description: The type of the format. Always grammar.
          enum:
            - grammar
        syntax:
          type: string
          enum:
            - lark
            - regex
          description: The syntax of the grammar definition. One of lark or regex.
        definition:
          type: string
          description: The grammar definition.
      required:
        - type
        - syntax
        - definition
      additionalProperties: false
      title: Grammar Format
      description: A grammar format for a custom tool, defined using Lark or regex syntax.
    PromptCacheBreakpoint:
      type: object
      properties:
        mode:
          type: string
          description: Creates an explicit prompt-cache breakpoint after this block.
          enum:
            - explicit
      required:
        - mode
      additionalProperties: false
      description: OpenAI explicit prompt-cache breakpoint settings.
    OutputText:
      type: object
      properties:
        type:
          type: string
          description: The type of the output content. Always output_text.
          enum:
            - output_text
        text:
          type: string
          description: The text output from the model.
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/Annotation'
          description: Annotations on the output text, such as URL citations.
          nullable: true
        logprobs:
          type: array
          items:
            type: object
            properties:
              token:
                type: string
              bytes:
                type: array
                items:
                  type: number
              logprob:
                type: number
              top_logprobs:
                type: array
                items:
                  type: object
                  properties:
                    token:
                      type: string
                    bytes:
                      type: array
                      items:
                        type: number
                    logprob:
                      type: number
                  required:
                    - token
                    - bytes
                    - logprob
                  additionalProperties: false
            required:
              - token
              - bytes
              - logprob
              - top_logprobs
            additionalProperties: false
          description: Log probability information for the output tokens.
          nullable: true
        cache_control:
          $ref: '#/components/schemas/CacheControl'
        prompt_cache_breakpoint:
          $ref: '#/components/schemas/PromptCacheBreakpoint'
      required:
        - type
        - text
      additionalProperties: false
      title: Output Text
      description: A text output from the model.
    WebSearchToolCallSearchAction:
      type: object
      properties:
        type:
          type: string
          description: The type of the action. Always search.
          enum:
            - search
        query:
          type: string
          description: The search query.
        queries:
          type: array
          items:
            type: string
          description: The list of search queries run.
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/Source'
          description: The sources consulted during the search.
          nullable: true
      required:
        - type
      additionalProperties: false
      title: Search Action
      description: A search action performed by the web search tool.
    WebSearchToolCallOpenPageAction:
      type: object
      properties:
        type:
          type: string
          description: The type of the action. Always open_page.
          enum:
            - open_page
        url:
          type: string
          description: The URL of the page opened.
          nullable: true
      required:
        - type
      additionalProperties: false
      title: Open Page
      description: An action where the web search tool opens a page.
    WebSearchToolCallFindAction:
      type: object
      properties:
        type:
          type: string
          description: The type of the action. Always find_in_page.
          enum:
            - find_in_page
        pattern:
          type: string
          description: The pattern searched for within the page.
        url:
          type: string
          description: The URL of the page searched.
      required:
        - type
        - pattern
        - url
      additionalProperties: false
      title: Find In Page
      description: An action where the web search tool searches within a page.
    Annotation:
      oneOf:
        - $ref: '#/components/schemas/UrlCitation'
      description: An annotation on the output text.
    Source:
      oneOf:
        - $ref: '#/components/schemas/UrlSource'
        - $ref: '#/components/schemas/ApiSource'
      description: A source consulted by the web search tool.
    UrlCitation:
      type: object
      properties:
        type:
          type: string
          description: The type of the annotation. Always url_citation.
          enum:
            - url_citation
        start_index:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: The index of the first character of the citation in the output text.
        end_index:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: The index of the last character of the citation in the output text.
        title:
          type: string
          description: The title of the cited web page.
        url:
          type: string
          description: The URL of the cited web page.
      required:
        - type
        - start_index
        - end_index
        - title
        - url
      additionalProperties: false
      title: URL Citation
      description: A citation to a URL in the output text.
    UrlSource:
      type: object
      properties:
        type:
          type: string
          description: The type of the source. Always url.
          enum:
            - url
        url:
          type: string
          description: The URL of the source.
      required:
        - type
        - url
      additionalProperties: false
      title: URL Source
      description: A web URL source consulted by the web search tool.
    ApiSource:
      type: object
      properties:
        type:
          type: string
          description: The type of the source. Always api.
          enum:
            - api
        name:
          type: string
          description: The name of the API source.
      required:
        - type
        - name
      additionalProperties: false
      title: API Source
      description: An API source consulted by the web search tool.

````