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

# Create model response (Responses format)

> Create a model response in OpenAI Responses API format with multi-turn and tool-calling support

## Models you can use

| Model ID          | Notes                                                         |
| ----------------- | ------------------------------------------------------------- |
| `gpt-5.4`         | GPT-5 flagship — top reasoning / coding / agentic, 1M context |
| `gpt-5.4-mini`    | Lightweight, balanced — great for high-volume and fallback    |
| `deepseek-v4-pro` | DeepSeek cost-effective reasoning model                       |

See [`GET /v1/models`](/api-reference/models/list-models) for the full list.

## Multi-turn continuation

Pass the `id` from a previous response as `previous_response_id` to
continue the conversation without resending the full history.

## Reasoning control

For reasoning-capable models, use `reasoning.effort` (`low` / `medium` /
`high`) to set reasoning depth, and `reasoning.summary` (`auto` /
`concise` / `detailed`) to control how much reasoning detail is returned.

## Context truncation

Set `truncation` to `auto` to let the system automatically drop older
context when the window is exceeded. Set to `disabled` to return an
error instead.


## OpenAPI

````yaml /openapi/chat.en.yaml post /v1/responses
openapi: 3.1.0
info:
  title: InfinityBlue API — Chat
  version: 1.0.0
  summary: Unified AI model API gateway — Chat endpoints
  description: >
    InfinityBlue is a unified API gateway for AI models. It exposes

    **OpenAI-, Google Gemini-, and Anthropic Claude-compatible** endpoints,

    backed by models from OpenAI, Google, DeepSeek, ByteDance (Seedance),

    Kuaishou (Kling), and more.


    You don't need to integrate each vendor separately — just point your

    base URL at InfinityBlue and keep using the official SDK you already know.


    ## Authentication


    Every request must include your API key in the header:


    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    Create and manage your API keys in the
    [console](https://api.getinfinityblue.com/console).


    ## Endpoint format conventions


    | Path prefix | Compatible format |

    | --- | --- |

    | `/v1/*` | OpenAI (Chat Completions, Responses, Images, etc.) |

    | `/v1/messages` | Anthropic Claude Messages |

    | `/v1beta/models/*` | Google Gemini native |


    ## Model selection


    Pass any model ID in the `model` parameter. See

    [`GET /v1/models`](/api-reference/models/list-models)

    or the [pricing page](https://api.getinfinityblue.com/pricing)

    for the full list.
  contact:
    name: InfinityBlue
    url: https://getinfinityblue.com
servers:
  - url: https://api.getinfinityblue.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: |
      Text conversations, vision, tool calling, streaming, and reasoning
      models — all through a single chat endpoint.
paths:
  /v1/responses:
    post:
      tags:
        - Chat
      summary: Create model response (Responses format)
      description: |
        Create a model response using the OpenAI Responses API format.
        Supports multi-turn conversations, tool calling, and reasoning.
        Compared to Chat Completions, the Responses API provides a stateless
        continuation mechanism via `previous_response_id`, making it well-suited
        for agentic workflows.
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              simple:
                summary: Basic text chat
                value:
                  model: gpt-5.4
                  input: Introduce yourself in one sentence.
              multi_turn:
                summary: Multi-turn continuation
                value:
                  model: gpt-5.4
                  input: Can you expand on the second point you mentioned?
                  previous_response_id: resp_abc123
              with_instructions:
                summary: With system instructions
                value:
                  model: gpt-5.4-mini
                  instructions: >-
                    You are a professional code reviewer. Always respond in
                    English.
                  input: Review this Python snippet for potential memory leaks.
              reasoning:
                summary: Reasoning model
                value:
                  model: deepseek-v4-pro
                  input: Prove that there are infinitely many prime numbers.
                  reasoning:
                    effort: high
                    summary: detailed
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResponsesRequest:
      type: object
      required:
        - model
      description: OpenAI Responses API request body.
      properties:
        model:
          type: string
          description: Model ID, e.g. `gpt-5.4`. See `GET /v1/models` for the full list.
          examples:
            - gpt-5.4
        input:
          description: |
            Input content — either a plain text string or an array of messages.
            Omit when using `previous_response_id` to continue a prior turn.
          oneOf:
            - type: string
            - type: array
              description: Message array in the same format as Chat Completions `messages`.
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - system
                      - user
                      - assistant
                      - tool
                    description: Message role.
                  content:
                    description: Message content — string or multimodal array.
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: object
        instructions:
          type: string
          description: >-
            System-level instructions, equivalent to a `system` message in Chat
            Completions.
        max_output_tokens:
          type: integer
          description: >-
            Maximum number of tokens the model may generate in this response,
            including reasoning tokens.
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: Sampling temperature between 0 and 2, controlling output randomness.
        top_p:
          type: number
          minimum: 0
          maximum: 1
          description: Nucleus sampling threshold. Tune this or `temperature`, not both.
        stream:
          type: boolean
          default: false
          description: Whether to stream the response as Server-Sent Events.
        tools:
          type: array
          description: A list of tools the model may call.
          items:
            type: object
        tool_choice:
          description: |
            Tool calling strategy — `auto`, `none`, or `required` as a string,
            or an object specifying a particular tool.
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
        reasoning:
          type: object
          description: >-
            Reasoning configuration, only effective for reasoning-capable
            models.
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
              description: Reasoning depth.
            summary:
              type: string
              enum:
                - auto
                - concise
                - detailed
              description: Level of detail in the reasoning summary.
        previous_response_id:
          type: string
          description: |
            The `id` of a prior response. When set, the conversation continues
            from that point without resending history.
        truncation:
          type: string
          enum:
            - auto
            - disabled
          description: |
            Context truncation strategy. `auto` drops older context when the
            window is exceeded; `disabled` returns an error instead.
    ResponsesResponse:
      type: object
      description: OpenAI Responses API response body.
      properties:
        id:
          type: string
          description: >-
            Unique identifier for this response, usable as
            `previous_response_id` in the next turn.
        object:
          type: string
          description: Object type, value is `response`.
          examples:
            - response
        created_at:
          type: integer
          description: Unix timestamp (seconds) of creation.
        status:
          type: string
          enum:
            - completed
            - failed
            - in_progress
            - incomplete
          description: Response status.
        model:
          type: string
          description: The model that actually processed the request.
        output:
          type: array
          description: List of output blocks generated by the model.
          items:
            type: object
            properties:
              type:
                type: string
                description: Output block type, e.g. `message`.
              id:
                type: string
                description: Output block ID.
              status:
                type: string
                description: Output block status.
              role:
                type: string
                description: Role, typically `assistant`.
              content:
                type: array
                description: List of content parts.
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: Content part type, e.g. `output_text`.
                    text:
                      type: string
                      description: Text content.
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      description: Standard error response.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message.
              examples:
                - Invalid duration. Supported range is 4 to 15 seconds.
            type:
              type: string
              description: Error type.
              examples:
                - invalid_request_error
            param:
              type:
                - string
                - 'null'
              description: The parameter related to the error.
              examples:
                - seconds
            code:
              type:
                - string
                - 'null'
              description: Error code.
              examples:
                - invalid_duration
    Usage:
      type: object
      description: Token usage statistics for the request.
      properties:
        prompt_tokens:
          type: integer
          description: Tokens consumed by the prompt.
        completion_tokens:
          type: integer
          description: Tokens consumed by the completion.
        total_tokens:
          type: integer
          description: Total tokens consumed.
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: Tokens served from cache.
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            image_tokens:
              type: integer
        completion_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            reasoning_tokens:
              type: integer
              description: Tokens consumed by reasoning.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >
        Bearer token authentication, format: `Authorization: Bearer sk-xxxxxx`.

        Get your API key in the
        [console](https://api.getinfinityblue.com/console).

````