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

# Answer

> Automatically decomposes user messages into multiple sub-queries, performs searches, and synthesizes results using an LLM.



## OpenAPI

````yaml /api-reference/openapi.json post /answer
openapi: 3.1.0
info:
  title: Octen API
  description: >-
    Octen API provides Broad Search, Web Search, Image Search, Video Search,
    Extract, Embeddings, VL Embeddings, Answer, and Deep Research services. The
    Web Search API searches ranked web results with optional filters,
    highlights, and full content. The Image Search API searches for images from
    a text query, an image, or both, with an optional design mode that returns a
    structured summary and a reusable HTML snippet for each result. The Video
    Search API searches for videos from a text query. The Broad Search API
    decomposes a query into multiple sub-queries, searches them in parallel, and
    returns results grouped by sub-query. The Extract API extracts clean content
    from URLs, with optional query-focused highlights, page classification, and
    multimedia resources. The Embeddings API converts text into vector
    representations. The VL Embeddings API converts multimodal inputs into
    vector representations. The Answer API decomposes queries into multiple
    sub-queries for comprehensive search and synthesis. The Deep Research API
    runs a multi-round adaptive research pipeline that produces a structured
    research plan, executes iterative searches, and streams a final long-form
    report.
  version: 1.0.0
servers:
  - url: https://api.octen.ai
security:
  - apiKeyAuth: []
paths:
  /answer:
    post:
      summary: Answer
      description: >-
        Automatically decomposes user messages into multiple sub-queries,
        performs searches, and synthesizes results using an LLM.
      operationId: answer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnswerRequest'
            examples:
              basic:
                summary: Basic Answer
                value:
                  model: anthropic/claude-sonnet-4.6
                  messages:
                    - role: user
                      content: >-
                        Latest trends and major players in the global AI chip
                        market in 2026
                  max_queries: 5
                  stream: false
                  web_search_options:
                    count: 10
                    highlight:
                      enable: true
                      max_tokens: 300
                    full_content:
                      enable: true
                      max_tokens: 2048
              queriesOnly:
                summary: Queries Only Mode
                value:
                  model: anthropic/claude-sonnet-4.6
                  messages:
                    - role: user
                      content: What are the latest developments in quantum computing?
                  mode: queries_only
                  max_queries: 10
              queriesAndSearch:
                summary: Queries and Search Mode (no LLM synthesis)
                value:
                  model: anthropic/claude-sonnet-4.6
                  messages:
                    - role: user
                      content: Compare Tesla and BYD electric vehicle sales in 2026
                  mode: queries_and_search
                  max_queries: 8
                  web_search_options:
                    count: 5
                    highlight:
                      enable: true
                      max_tokens: 300
              multiTurn:
                summary: Multi-turn Conversation
                value:
                  model: anthropic/claude-sonnet-4.6
                  messages:
                    - role: user
                      content: Who are the major players in the current chip market?
                    - role: assistant
                      content: >-
                        Major players include NVIDIA, AMD, Intel, Broadcom,
                        Google, Amazon, etc.
                    - role: user
                      content: What are their latest developments?
                  max_queries: 10
                  stream: false
              withDomainFilter:
                summary: With Domain and Time Filters
                value:
                  model: anthropic/claude-sonnet-4.6
                  messages:
                    - role: user
                      content: Latest central bank interest rate decisions globally
                  max_queries: 15
                  stream: false
                  web_search_options:
                    count: 10
                    include_domains:
                      - reuters.com
                    exclude_domains:
                      - medium.com
                    include_text:
                      - interest rate
                      - central bank
                    exclude_text:
                      - opinion
                      - rumor
                    time_basis: published
                    start_time: '2025-01-01T00:00:00Z'
                    end_time: '2025-01-31T23:59:59Z'
                    highlight:
                      enable: true
                      max_tokens: 300
                    format: markdown
                    safesearch: strict
                    full_content:
                      enable: true
                      max_tokens: 2048
      responses:
        '200':
          description: >-
            Successful Answer response. When `stream=false`, returns a single
            `chat.completion` object with `queries` and `search_results` at the
            top level. When `stream=true`, returns a stream of
            `chat.completion.chunk` objects with types: `queries` (generated
            sub-queries), `search_done` (search results), `content` (incremental
            content), `finish` (completion signal), and `usage` (token usage).
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AnswerResponse'
                  - $ref: '#/components/schemas/AnswerChunk'
                discriminator:
                  propertyName: object
                  mapping:
                    chat.completion:
                      $ref: '#/components/schemas/AnswerResponse'
                    chat.completion.chunk:
                      $ref: '#/components/schemas/AnswerChunk'
              examples:
                nonStreaming:
                  summary: Non-streaming response (chat.completion)
                  value:
                    request_id: 20260403120000001ABCDE12345
                    object: chat.completion
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    choices:
                      - index: 0
                        finish_reason: stop
                        message:
                          role: assistant
                          content: >-
                            ## Global AI Chip Market in 2026: Latest Trends &
                            Major Players


                            **The AI chip market was valued at approximately
                            $102.9 billion in 2025, and is projected to grow at
                            a 29.4% CAGR to $1.35 trillion by 2035.** NVIDIA
                            continues to dominate with over 80% data center
                            market share, but the custom ASIC chip wave is
                            accelerating challenges to its position.[^1][^6]


                            ### Major Players Overview


                            | Company | Core Strength | Key 2026 Developments |

                            |---|---|---|

                            | **NVIDIA** | Data center GPU, >80% market share |
                            Blackwell/Rubin roadmap, $1T revenue target |

                            | **Broadcom** | Custom ASIC chips | Expected to
                            capture 60% of custom AI chip market by 2027 |

                            | **AMD** | GPU alternative | MI450 chip volume ramp
                            in H2, OpenAI/Meta large orders |

                            | **Intel** | CPU + foundry | Gaudi 3 launch, Xeon 6
                            selected for Nvidia DGX systems |

                            | **Google** | In-house TPU (Ironwood) | Surging HBM
                            demand |

                            | **Amazon AWS** | Trainium series | Anthropic
                            training Claude on over 1M Trainium2 chips |
                    queries:
                      - 2026 global AI chip market trends
                      - AI chip market share 2026
                      - top AI chip manufacturers 2026
                      - NVIDIA AI chip dominance 2026
                      - AMD AI chip strategy 2026
                    search_results:
                      - query: 2026 global AI chip market trends
                        results:
                          - title: >-
                              AI Chip Market Size to Exceed USD 1354.35 Billion
                              by 2035
                            url: >-
                              http://globenewswire.com/news-release/2026/04/01/...
                            highlight: >-
                              According to the SNS Insider, The AI Chip Market
                              Size was valued at USD 102.89 Billion in 2025 and
                              is expected to reach USD 1354.35 Billion by
                              2035...
                            full_content: ''
                            authors: SNS Insider pvt ltd
                            time_published: '2026-04-01T07:30:00Z'
                            time_last_crawled: '2026-04-02T03:18:46Z'
                        latency: 69
                      - query: AI chip market share 2026
                        results:
                          - title: Another result title...
                            url: https://example.com/...
                            highlight: ...
                            full_content: ''
                            authors: ...
                            time_published: '2026-03-28T00:00:00Z'
                            time_last_crawled: '2026-03-29T12:00:00Z'
                        latency: 72
                    meta:
                      usage:
                        num_search_queries: 20
                        prompt_tokens: 35351
                        completion_tokens: 942
                        total_tokens: 36293
                      latency: 24048
                streamQueries:
                  summary: 'Streaming chunk — queries (type: queries)'
                  value:
                    type: queries
                    request_id: 20260403120000002XYZAB67890
                    object: chat.completion.chunk
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    queries:
                      - latest quantum computing developments 2026
                      - quantum computing breakthroughs 2026
                streamSearchDone:
                  summary: 'Streaming chunk — search results (type: search_done)'
                  value:
                    type: search_done
                    request_id: 20260403120000002XYZAB67890
                    object: chat.completion.chunk
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    search_results:
                      - query: latest quantum computing developments 2026
                        results:
                          - title: Stocks to Gain From Quantum Computing in 2025
                            url: https://www.nasdaq.com/articles/...
                            highlight: >-
                              This year has seen quantum computing being pushed
                              from lab interests toward practical deployments...
                            full_content: ''
                            authors: ''
                            time_published: '2026-03-15T00:00:00Z'
                            time_last_crawled: '2026-03-16T12:00:00Z'
                        latency: 65
                streamContent:
                  summary: 'Streaming chunk — content (type: content)'
                  value:
                    type: content
                    request_id: 20260403120000002XYZAB67890
                    object: chat.completion.chunk
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    choices:
                      - index: 0
                        delta:
                          content: '**Quantum computing'
                        finish_reason: null
                streamFinish:
                  summary: 'Streaming chunk — finish (type: finish)'
                  value:
                    type: finish
                    request_id: 20260403120000002XYZAB67890
                    object: chat.completion.chunk
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    choices:
                      - index: 0
                        delta: {}
                        finish_reason: stop
                streamUsage:
                  summary: 'Streaming chunk — usage (type: usage)'
                  value:
                    type: usage
                    request_id: 20260403120000002XYZAB67890
                    object: chat.completion.chunk
                    created: 1775361600
                    model: anthropic/claude-sonnet-4.6
                    meta:
                      usage:
                        num_search_queries: 2
                        prompt_tokens: 2664
                        completion_tokens: 78
                        total_tokens: 2742
                      latency: 3565
        '400':
          description: >-
            Missing parameter messages — Returned when a required parameter is
            missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 400
                msg: Missing parameter messages
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientBalance'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    AnswerRequest:
      type: object
      required:
        - messages
      description: Request body for the Answer API.
      properties:
        model:
          type: string
          enum:
            - anthropic/claude-opus-4.8
            - anthropic/claude-opus-4.6
            - anthropic/claude-sonnet-4.6
            - anthropic/claude-haiku-4.5
            - google/gemini-3.5-flash
            - google/gemini-3.1-pro-preview
            - google/gemini-3.1-flash-lite
            - google/gemini-3-flash-preview
            - openai/gpt-5.5-pro
            - openai/gpt-5.5
            - openai/gpt-5.4
            - moonshotai/kimi-k2.6
            - moonshotai/kimi-k2.5
            - minimax/minimax-m2.5
            - qwen/qwen3.6-plus
          default: anthropic/claude-sonnet-4.6
          description: The model to use for query decomposition and response synthesis.
        messages:
          type: array
          description: >-
            A list of messages comprising the conversation so far. User and
            assistant messages in chronological order for multi-turn
            conversations.
          items:
            $ref: '#/components/schemas/ChatMessage'
        mode:
          type: string
          enum:
            - queries_only
            - queries_and_search
            - full
          default: full
          description: >-
            Controls the execution depth. `queries_only`: only decompose the
            message into sub-queries without performing searches;
            `queries_and_search`: decompose into sub-queries and return search
            results without LLM synthesis; `full`: decompose, search, and
            synthesize a final response using the LLM.
        max_queries:
          type: integer
          minimum: 1
          maximum: 30
          default: 30
          description: Maximum number of sub-queries to generate.
        web_search_options:
          allOf:
            - $ref: '#/components/schemas/ChatWebSearchOptions'
          description: >-
            Search options. Shares the same parameters and defaults as the Web
            Search API, except `highlight.max_tokens` defaults to 256. Queries
            are automatically generated from the messages.
        stream:
          type: boolean
          default: false
          description: >-
            Whether to enable streaming output. When `true`, returns
            `chat.completion.chunk` objects incrementally with types: `queries`,
            `search_done`, `content`, `finish`, and `usage`.
    AnswerResponse:
      type: object
      description: A non-streaming Answer response. Returned when `stream=false`.
      required:
        - request_id
        - object
        - created
        - model
        - choices
      properties:
        request_id:
          type: string
          description: The unique identifier for this request.
        object:
          type: string
          enum:
            - chat.completion
          description: >-
            The object type, always `chat.completion` for non-streaming
            responses.
        created:
          type: number
          description: Unix timestamp (in seconds) of when the completion was created.
        model:
          type: string
          description: The model used for this completion.
        choices:
          type: array
          description: A list of completion choices containing the synthesized response.
          items:
            $ref: '#/components/schemas/ChatCompletionChoice'
        queries:
          type: array
          items:
            type: string
          description: >-
            The list of sub-queries automatically generated from the user
            message by the system.
        search_results:
          type: array
          description: >-
            Search results grouped by query. Each auto-generated sub-query has a
            corresponding result group.
          items:
            $ref: '#/components/schemas/SearchResultGroup'
        meta:
          $ref: '#/components/schemas/AnswerMeta'
        warning:
          type: string
          nullable: true
          description: Warning message, if any.
    AnswerChunk:
      type: object
      description: >-
        A streaming chunk of an Answer response. Returned when `stream=true`.
        The `type` field indicates the chunk kind: `queries` (auto-generated
        sub-queries), `search_done` (search results available), `content`
        (incremental content), `finish` (generation complete), `usage` (token
        usage summary).
      required:
        - request_id
        - object
        - created
        - model
      properties:
        type:
          type: string
          enum:
            - queries
            - search_done
            - content
            - finish
            - usage
          description: >-
            The type of this streaming chunk. The `queries` type contains the
            auto-generated sub-queries.
        request_id:
          type: string
          description: The unique identifier for this request.
        object:
          type: string
          enum:
            - chat.completion.chunk
          description: >-
            The object type, always `chat.completion.chunk` for streaming
            responses.
        created:
          type: number
          description: Unix timestamp (in seconds) of when the chunk was created.
        model:
          type: string
          description: The model used for this completion.
        queries:
          type: array
          items:
            type: string
          description: Auto-generated sub-queries. Present only in `queries` type chunks.
        choices:
          type: array
          description: Incremental choices. Present in `content` and `finish` chunks.
          items:
            $ref: '#/components/schemas/ChatCompletionChunkChoice'
        search_results:
          type: array
          description: Search results grouped by query. Present in `search_done` chunks.
          items:
            $ref: '#/components/schemas/SearchResultGroup'
        meta:
          $ref: '#/components/schemas/AnswerMeta'
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Business status code. Non-zero values indicate an error.
        msg:
          type: string
          description: A human-readable message describing the error.
      required:
        - code
        - msg
    ChatMessage:
      description: A single message in the conversation. Discriminated by `role`.
      oneOf:
        - $ref: '#/components/schemas/SystemMessage'
        - $ref: '#/components/schemas/UserMessage'
        - $ref: '#/components/schemas/AssistantMessage'
        - $ref: '#/components/schemas/ToolMessage'
      discriminator:
        propertyName: role
        mapping:
          system:
            $ref: '#/components/schemas/SystemMessage'
          user:
            $ref: '#/components/schemas/UserMessage'
          assistant:
            $ref: '#/components/schemas/AssistantMessage'
          tool:
            $ref: '#/components/schemas/ToolMessage'
    ChatWebSearchOptions:
      type: object
      description: >-
        Search options. All parameters are optional and share the same semantics
        and defaults as the Web Search API. The query is automatically generated
        from the messages.
      properties:
        count:
          type: integer
          minimum: 1
          maximum: 100
          description: Number of search results to return.
        include_domains:
          type: array
          items:
            type: string
          description: Domains to include in search results.
        exclude_domains:
          type: array
          items:
            type: string
          description: Domains to exclude from search results.
        include_text:
          type: array
          items:
            type: string
          maxItems: 5
          description: Strings that must appear in the result page text.
        exclude_text:
          type: array
          items:
            type: string
          maxItems: 5
          description: Strings that must not appear in the result page text.
        time_basis:
          type: string
          enum:
            - auto
            - published
            - crawled
          description: Determines which time field is used for time filtering.
        start_time:
          type: string
          format: date-time
          description: Start time for filtering results. ISO 8601 format.
        end_time:
          type: string
          format: date-time
          description: End time for filtering results. ISO 8601 format.
        highlight:
          $ref: '#/components/schemas/HighlightOptions'
        format:
          type: string
          enum:
            - markdown
            - text
          description: Controls the formatting of highlight outputs.
        safesearch:
          type: string
          enum:
            - 'off'
            - strict
          description: Controls filtering of explicit/adult content.
        full_content:
          $ref: '#/components/schemas/FullContentOptions'
        include_images:
          type: boolean
          default: false
          description: >-
            Whether to include images (cover_image and in-body images) in each
            result.
        include_videos:
          type: boolean
          default: false
          description: Whether to include videos in each result.
    ChatCompletionChoice:
      type: object
      description: A single completion choice in a non-streaming response.
      properties:
        index:
          type: number
          description: The index of this choice in the list. Usually 0.
        finish_reason:
          type: string
          enum:
            - stop
            - length
            - tool_calls
            - content_filter
            - error
          description: >-
            The reason the model stopped generating. `stop` indicates normal
            completion.
        message:
          $ref: '#/components/schemas/ChatCompletionMessage'
    SearchResultGroup:
      type: object
      description: A group of search results for a single sub-query.
      properties:
        query:
          type: string
          description: The auto-generated sub-query that produced these results.
        results:
          type: array
          description: The search results for this sub-query.
          items:
            $ref: '#/components/schemas/SearchResult'
        latency:
          type: integer
          description: Search latency for this query in milliseconds.
    AnswerMeta:
      type: object
      description: Metadata for the Answer response.
      properties:
        usage:
          $ref: '#/components/schemas/SynthesisUsage'
        latency:
          type: integer
          description: Total request latency in milliseconds.
    ChatCompletionChunkChoice:
      type: object
      description: A single choice in a streaming chunk.
      properties:
        index:
          type: number
          description: The index of this choice. Usually 0.
        delta:
          $ref: '#/components/schemas/ChatCompletionDelta'
        finish_reason:
          type: string
          nullable: true
          enum:
            - stop
            - length
            - tool_calls
            - content_filter
            - error
            - null
          description: >-
            The reason generation stopped. `null` for intermediate chunks; set
            in the `finish` chunk.
    SystemMessage:
      type: object
      required:
        - role
        - content
      description: A system prompt message that sets the behavior or context for the model.
      properties:
        role:
          type: string
          enum:
            - system
          description: The role of the message author. Always `system`.
        content:
          type: string
          description: The system prompt content.
    UserMessage:
      type: object
      required:
        - role
        - content
      description: A message from the user.
      properties:
        role:
          type: string
          enum:
            - user
          description: The role of the message author. Always `user`.
        content:
          description: >-
            The content of the message. Can be a plain string or an array of
            content blocks (text and/or image).
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ChatContentBlock'
    AssistantMessage:
      type: object
      required:
        - role
      description: >-
        A message from the assistant. May contain text content, tool calls, or
        both. When replaying a multi-turn conversation with tool use, include
        the assistant's `tool_calls` so the model can match them with the
        subsequent `tool` messages.
      properties:
        role:
          type: string
          enum:
            - assistant
          description: The role of the message author. Always `assistant`.
        content:
          type: string
          nullable: true
          description: >-
            The assistant's text content. May be `null` or omitted when the
            assistant only produces tool calls.
        tool_calls:
          type: array
          description: >-
            Tool calls generated by the model. Each tool call must be answered
            by a corresponding `tool` message with a matching `tool_call_id`.
          items:
            $ref: '#/components/schemas/ChatToolCall'
    ToolMessage:
      type: object
      required:
        - role
        - tool_call_id
        - content
      description: >-
        A tool result message, providing the output of a tool call back to the
        model. The `tool_call_id` must match the `id` of a preceding
        `tool_calls` entry in an assistant message.
      properties:
        role:
          type: string
          enum:
            - tool
          description: The role of the message author. Always `tool`.
        tool_call_id:
          type: string
          description: >-
            The ID of the tool call this message is responding to. Must match an
            `id` from a preceding assistant message's `tool_calls`.
        content:
          type: string
          description: The tool output, typically a JSON string with the function result.
    HighlightOptions:
      type: object
      description: Controls highlight extraction from result pages.
      properties:
        enable:
          type: boolean
          default: true
          description: If true, returns query-relevant highlight in each result.
        max_tokens:
          type: integer
          default: 512
          minimum: 100
          maximum: 20000
          description: Max tokens returned per highlight.
    FullContentOptions:
      type: object
      description: Controls whether to return the full raw content of each result page.
      properties:
        enable:
          type: boolean
          default: false
          description: If true, returns full_content for each result.
        max_tokens:
          type: integer
          default: 2048
          minimum: 100
          maximum: 100000
          description: Maximum tokens of full content included per result.
    ChatCompletionMessage:
      type: object
      description: >-
        The assistant's response message (non-streaming). For reasoning models,
        the thinking process appears as `<think>...</think>` tags within the
        `content` field. In streaming mode, reasoning content is delivered via
        `delta.reasoning_content` instead.
      properties:
        role:
          type: string
          enum:
            - assistant
            - tool
          description: The role of the message author. Usually `assistant`.
        content:
          type: string
          nullable: true
          description: >-
            The assistant's text content. May be `null` when the model only
            produces tool calls, or in refusal scenarios. For reasoning models,
            this field may contain `<think>...</think>` tags wrapping the
            model's reasoning process before the final answer.
        tool_calls:
          type: array
          description: >-
            Tool calls generated by the model. Only present when the model
            decides to invoke one or more tools. Each call includes an `id` that
            must be referenced by a subsequent `tool` message.
          items:
            $ref: '#/components/schemas/ChatToolCall'
        refusal:
          type: string
          description: >-
            A model-generated refusal message. Only present when the model
            refuses a request.
    SearchResult:
      type: object
      description: A single search result.
      properties:
        title:
          type: string
          description: The title of the result page.
        url:
          type: string
          description: The URL of the result page.
        highlight:
          type: string
          description: >-
            Query-relevant highlight snippets. Returned only if highlight.enable
            is true.
        full_content:
          type: string
          description: Full raw page content. Returned only if full_content.enable is true.
        authors:
          type: string
          description: Website name or author.
        time_published:
          type: string
          format: date-time
          description: Publish time in ISO 8601.
        time_last_crawled:
          type: string
          format: date-time
          description: Last crawl time in ISO 8601.
        favicon:
          type: string
          description: The favicon URL of the result site.
        cover_image:
          type: object
          description: >-
            The page cover image. Returned only when `include_images` is true
            and the page has a cover image.
          properties:
            url:
              type: string
              description: The cover image URL.
            description:
              type: string
              description: Text description of the cover image. May be empty.
        images:
          type: array
          description: >-
            In-body images of the page, in order of appearance. Returned only
            when `include_images` is true.
          items:
            type: object
            properties:
              url:
                type: string
                description: The image URL.
              description:
                type: string
                description: Text description of the image. May be empty.
        videos:
          type: array
          description: >-
            In-body videos of the page, in order of appearance. Returned only
            when `include_videos` is true.
          items:
            type: object
            properties:
              url:
                type: string
                description: The video URL.
              description:
                type: string
                description: Text description of the video. May be empty.
    SynthesisUsage:
      type: object
      description: >-
        Token usage information for the Answer response. When `stream=true`,
        this is only present in the `usage` type chunk.
      required:
        - num_search_queries
        - prompt_tokens
        - completion_tokens
        - total_tokens
      properties:
        num_search_queries:
          type: integer
          description: Total number of search queries executed across all sub-queries.
        prompt_tokens:
          type: integer
          description: Number of input tokens.
        completion_tokens:
          type: integer
          description: Number of output tokens.
        total_tokens:
          type: integer
          description: Total tokens used (prompt_tokens + completion_tokens).
    ChatCompletionDelta:
      type: object
      description: >-
        Incremental content in a streaming chunk. Contains only the new fields
        for this chunk.
      properties:
        role:
          type: string
          enum:
            - assistant
          description: The role. Typically included in the first chunk.
        reasoning_content:
          type: string
          description: >-
            Incremental reasoning content from reasoning models. Present during
            the thinking phase before the final answer. Concatenate across
            chunks to build the complete reasoning. Only appears for
            reasoning-capable models (`google/gemini-3.1-pro-preview`,
            `moonshotai/kimi-k2.6`, `moonshotai/kimi-k2.5`,
            `minimax/minimax-m2.5`).
        content:
          type: string
          description: Incremental text content.
        tool_calls:
          type: array
          description: >-
            Incremental tool call data. Present when the model invokes tools
            during streaming. Each chunk may contain partial function name or
            arguments that should be concatenated.
          items:
            $ref: '#/components/schemas/ChatToolCallDelta'
    ChatContentBlock:
      type: object
      description: A content block within a message. Supports text and image types.
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
          description: The type of content block.
        text:
          type: string
          description: The text content. Required when `type` is `text`.
        image_url:
          type: object
          description: Image URL object. Required when `type` is `image_url`.
          properties:
            url:
              type: string
              description: The URL of the image.
          required:
            - url
      required:
        - type
    ChatToolCall:
      type: object
      required:
        - id
        - type
        - function
      description: A tool call generated by the model.
      properties:
        index:
          type: number
          description: The index of this tool call in the tool_calls array.
        id:
          type: string
          description: >-
            A unique identifier for this tool call. Referenced by the
            corresponding `tool` message's `tool_call_id`.
        type:
          type: string
          enum:
            - function
          description: The type of tool call. Currently only `function` is supported.
        function:
          $ref: '#/components/schemas/ChatToolCallFunction'
    ChatToolCallDelta:
      type: object
      description: >-
        Incremental tool call data in a streaming chunk. The first chunk for a
        tool call includes `id`, `type`, and `function.name`. Subsequent chunks
        append to `function.arguments`.
      properties:
        index:
          type: number
          description: The index of this tool call in the tool_calls array.
        id:
          type: string
          description: >-
            The tool call ID. Only present in the first chunk for this tool
            call.
        type:
          type: string
          enum:
            - function
          description: The type of tool call.
        function:
          type: object
          description: Incremental function call data.
          properties:
            name:
              type: string
              description: >-
                The function name. Only present in the first chunk for this tool
                call.
            arguments:
              type: string
              description: >-
                Incremental JSON string of the function arguments. Concatenate
                across chunks to build the complete arguments.
    ChatToolCallFunction:
      type: object
      required:
        - name
        - arguments
      description: The function invocation details within a tool call.
      properties:
        name:
          type: string
          description: The name of the function to call.
        arguments:
          type: string
          description: >-
            The arguments to the function, as a JSON string generated by the
            model.
  responses:
    Unauthorized:
      description: Invalid API Key — Returned when the API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            msg: Invalid API Key
    InsufficientBalance:
      description: >-
        Insufficient balance in account — Returned when the account balance is
        insufficient to complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 403
            msg: Insufficient balance in account
    RateLimited:
      description: >-
        Exceeding the rate limit — Returned when the request exceeds the
        configured rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            msg: Exceeding the rate limit
    InternalError:
      description: Internal error — Returned when an unexpected server-side error occurs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            msg: Internal error
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key used for request authentication. Obtain an API key before using
        the API. Note: A payment method is required to use the API.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication. Compatible with OpenAI protocol. Pass the
        API key as `Authorization: Bearer <your-api-key>`.

````