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

# Create a model response

> Creates a model response for the given input. Designed for agentic workflows with structured output items (messages, reasoning, function calls). Only `type: "function"` tools are supported. Stateless API - supply full conversation history via `input[]` on each request.



## OpenAPI

````yaml /en/api-reference/openapi_infercom.yml post /responses
openapi: 3.1.1
info:
  title: Infercom Inference Service API
  description: Infercom Inference Service API Specification
  version: 1.0.0
  termsOfService: https://infercom.ai/terms-of-service
  contact:
    email: support@infercom.ai
    name: Infercom Support
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.infercom.ai/v1
security:
  - api_key: []
externalDocs:
  description: Find out more in the official Infercom docs
  url: /en/api-reference/overview
paths:
  /responses:
    post:
      tags:
        - Responses
      summary: Create a model response
      description: >-
        Creates a model response for the given input. Designed for agentic
        workflows with structured output items (messages, reasoning, function
        calls). Only `type: "function"` tools are supported. Stateless API -
        supply full conversation history via `input[]` on each request.
      operationId: createResponse
      requestBody:
        required: true
        description: Response creation parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponseRequest'
      responses:
        '200':
          description: >-
            Successful response. Returns a ResponseResponse object
            (non-streaming), or a stream of Server-Sent Events (when stream:
            true).
          headers:
            inference-id:
              $ref: '#/components/headers/InferenceId'
            x-ratelimit-limit-requests:
              $ref: '#/components/headers/RateLimitRequests'
            x-ratelimit-limit-requests-day:
              $ref: '#/components/headers/RateLimitRequestsDay'
            x-ratelimit-remaining-requests:
              $ref: '#/components/headers/RateLimitRemainingRequests'
            x-ratelimit-remaining-requests-day:
              $ref: '#/components/headers/RateLimitRemainingRequestsDay'
            x-ratelimit-reset-requests:
              $ref: '#/components/headers/RateLimitResetRequests'
            x-ratelimit-reset-requests-day:
              $ref: '#/components/headers/RateLimitResetRequestsDay'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseResponse'
        '400':
          description: Bad Request - Missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
              examples:
                missing_input:
                  summary: Required field missing
                  value:
                    error:
                      message: 'Missing required field: ''input''.'
                      type: invalid_request_error
                      param: input
                      code: missing_required_field
                unsupported_model:
                  summary: Model not supported for Responses API
                  value:
                    error:
                      message: Unsupported model DeepSeek-V3.1 on Response API
                      type: invalid_request_error
                      code: unsupported_model
                unsupported_tool:
                  summary: Built-in tools not supported
                  value:
                    error:
                      message: >-
                        built-in/server-side tools are not supported; only
                        "function" type tools are accepted
                      type: invalid_request_error
                      code: unsupported_tool_type
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
        '404':
          description: Not found - Model does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralError'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                type: string
      security:
        - api_key: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import OpenAI from 'openai';

            const client = new OpenAI({
              baseURL: 'https://api.infercom.ai/v1',
              apiKey: process.env['INFERCOM_API_KEY'],
            });

            const response = await client.responses.create({
              model: 'MiniMax-M2.5',
              input: 'Explain supervised vs unsupervised learning.',
            });

            console.log(response.output_text);
        - lang: Python
          source: |-
            from openai import OpenAI

            client = OpenAI(
                base_url="https://api.infercom.ai/v1",
                api_key="your-infercom-api-key",
            )

            response = client.responses.create(
                model="MiniMax-M2.5",
                input="Explain supervised vs unsupervised learning.",
            )

            print(response.output_text)
        - lang: cURL
          source: |-
            curl -X POST https://api.infercom.ai/v1/responses \
              -H "Authorization: Bearer $INFERCOM_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "model": "MiniMax-M2.5",
                "input": "Explain supervised vs unsupervised learning."
              }'
components:
  schemas:
    ResponseRequest:
      title: Response Request
      type: object
      description: Request body for creating a model response.
      properties:
        model:
          title: Model
          type: string
          description: The model ID to use (e.g., MiniMax-M2.5, gpt-oss-120b).
          example: MiniMax-M2.5
        input:
          title: Input
          description: Text input or structured conversation history.
          oneOf:
            - type: string
              description: Plain text input (equivalent to a user message).
            - type: array
              items:
                $ref: '#/components/schemas/ResponseInputItem'
              description: >-
                Ordered list of input items (messages, tool calls, tool
                results).
        instructions:
          title: Instructions
          type: string
          description: System message prepended to input.
          nullable: true
        stream:
          title: Stream
          type: boolean
          description: If true, stream response as Server-Sent Events.
          default: false
        max_output_tokens:
          title: Max Output Tokens
          type: integer
          description: Maximum tokens to generate.
          nullable: true
        temperature:
          title: Temperature
          type: number
          description: Randomness control (0-2).
          minimum: 0
          maximum: 2
          default: 0.7
        top_p:
          title: Top P
          type: number
          description: Nucleus sampling cutoff (0-1).
          minimum: 0
          maximum: 1
          default: 1
        top_k:
          title: Top K
          type: integer
          description: Top-K sampling (1-100).
          minimum: 1
          maximum: 100
          nullable: true
        tools:
          title: Tools
          type: array
          description: Function tools available to the model (max 128).
          items:
            $ref: '#/components/schemas/ResponseTool'
          maxItems: 128
          nullable: true
        tool_choice:
          $ref: '#/components/schemas/ResponseToolChoiceOption'
        parallel_tool_calls:
          title: Parallel Tool Calls
          type: boolean
          description: Allow multiple tool calls in parallel.
          default: true
        text:
          title: Text
          type: object
          description: Response format configuration.
          properties:
            format:
              $ref: '#/components/schemas/ResponseFormatConfiguration'
        reasoning:
          title: Reasoning
          type: object
          description: Reasoning configuration for supported models.
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
              default: medium
              description: Reasoning depth level.
          nullable: true
        user:
          title: User
          type: string
          description: User identifier (echoed in response).
          nullable: true
      required:
        - model
        - input
    ResponseResponse:
      title: Response Response
      type: object
      description: Response object from POST /responses.
      properties:
        id:
          type: string
          description: Unique response identifier.
        object:
          type: string
          enum:
            - response
          description: Object type, always "response".
        status:
          type: string
          enum:
            - completed
            - failed
            - in_progress
            - incomplete
          description: Response lifecycle status.
        created_at:
          type: integer
          description: Unix timestamp when created.
        completed_at:
          type: integer
          description: Unix timestamp when completed.
          nullable: true
        model:
          type: string
          description: Model ID used.
        output:
          type: array
          items:
            $ref: '#/components/schemas/ResponseOutputItem'
          description: Output items (messages, reasoning, function calls).
        usage:
          $ref: '#/components/schemas/ResponseUsage'
        error:
          type: object
          description: Error details when status is "failed".
          properties:
            code:
              type: string
            message:
              type: string
          nullable: true
        instructions:
          type: string
          description: Echoed system instructions.
          nullable: true
        temperature:
          type: number
          nullable: true
        top_p:
          type: number
          nullable: true
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ResponseTool'
        tool_choice:
          $ref: '#/components/schemas/ResponseToolChoiceOption'
        parallel_tool_calls:
          type: boolean
        text:
          type: object
          properties:
            format:
              $ref: '#/components/schemas/ResponseFormatConfiguration'
        reasoning:
          type: object
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
              nullable: true
            summary:
              type: string
              nullable: true
          nullable: true
        store:
          type: boolean
          description: Always false (stateless API).
        service_tier:
          type: string
          nullable: true
      required:
        - id
        - object
        - status
        - created_at
        - model
        - output
      example:
        id: resp_abc123
        object: response
        status: completed
        created_at: 1778845598
        completed_at: 1778845598
        model: MiniMax-M2.5
        output:
          - type: reasoning
            id: rs_xyz
            status: completed
            summary: []
            content:
              - type: reasoning_text
                text: The user asks a simple question...
          - type: message
            id: msg_xyz
            role: assistant
            status: completed
            content:
              - type: output_text
                text: 2 + 2 = 4.
        usage:
          input_tokens: 45
          output_tokens: 89
          total_tokens: 134
          output_tokens_details:
            reasoning_tokens: 77
        parallel_tool_calls: true
        tools: []
        store: false
    GeneralError:
      title: GeneralError
      type: object
      description: other kind of errors
      properties:
        error:
          type: object
          properties:
            code:
              title: code
              type: string
              description: error code
              nullable: true
            message:
              title: message
              type: string
              description: error message
            param:
              title: param
              type: string
              description: error params
              nullable: true
            type:
              title: type
              type: string
              description: error type
      required:
        - error
    ResponseInputItem:
      title: Response Input Item
      description: An input item for the Responses API conversation history.
      oneOf:
        - $ref: '#/components/schemas/ResponseInputMessage'
        - $ref: '#/components/schemas/ResponseInputFunctionCall'
        - $ref: '#/components/schemas/ResponseInputFunctionCallOutput'
    ResponseTool:
      title: Response Tool
      type: object
      description: A function tool definition for the Responses API.
      properties:
        type:
          type: string
          enum:
            - function
          description: Tool type. Only "function" is supported.
        name:
          type: string
          description: The name of the function.
        description:
          type: string
          description: A description of what the function does.
        parameters:
          type: object
          description: JSON Schema describing the function parameters.
        strict:
          type: boolean
          nullable: true
          description: Whether to enforce strict schema validation.
      required:
        - type
        - name
    ResponseToolChoiceOption:
      title: Response Tool Choice Option
      description: Controls how the model uses tools.
      oneOf:
        - enum:
            - none
            - auto
            - required
          type: string
        - type: object
          properties:
            type:
              type: string
              enum:
                - function
            name:
              type: string
              description: The name of the function to call.
          required:
            - type
            - name
    ResponseFormatConfiguration:
      title: Response Format Configuration
      description: Output format configuration for structured responses.
      oneOf:
        - $ref: '#/components/schemas/ResponseFormatText'
        - $ref: '#/components/schemas/ResponseFormatJSONObject'
        - $ref: '#/components/schemas/ResponseFormatJSONSchema'
    ResponseOutputItem:
      title: Response Output Item
      description: An output item in the response (message, reasoning, or function_call).
      oneOf:
        - $ref: '#/components/schemas/ResponseMessage'
        - $ref: '#/components/schemas/ResponseFunctionCall'
        - $ref: '#/components/schemas/ResponseOutputReasoning'
      discriminator:
        propertyName: type
        mapping:
          message:
            $ref: '#/components/schemas/ResponseMessage'
          function_call:
            $ref: '#/components/schemas/ResponseFunctionCall'
          reasoning:
            $ref: '#/components/schemas/ResponseOutputReasoning'
    ResponseUsage:
      title: Response Usage
      type: object
      description: Token usage statistics for the response.
      properties:
        input_tokens:
          type: integer
          description: Number of input tokens.
        output_tokens:
          type: integer
          description: Number of output tokens generated.
        total_tokens:
          type: integer
          description: Total tokens (input + output).
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: Tokens served from cache.
          nullable: true
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: Tokens used for reasoning.
          nullable: true
        time_to_first_token:
          type: number
          description: Time to first token in seconds.
          nullable: true
        total_latency:
          type: number
          description: Total generation time in seconds.
          nullable: true
        output_tokens_per_sec:
          type: number
          description: Output throughput (tokens/second).
          nullable: true
      required:
        - input_tokens
        - output_tokens
        - total_tokens
    ResponseInputMessage:
      title: Response Input Message
      type: object
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - developer
          description: The role of the message author.
        content:
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ResponseContentPart'
          description: The content of the message.
        type:
          type: string
          enum:
            - message
          default: message
      required:
        - role
        - content
    ResponseInputFunctionCall:
      title: Response Input Function Call
      type: object
      properties:
        type:
          type: string
          enum:
            - function_call
        id:
          type: string
          description: Unique identifier for this function call.
        call_id:
          type: string
          description: Call ID for matching with function_call_output.
        name:
          type: string
          description: Name of the function.
        arguments:
          type: string
          description: JSON string of function arguments.
        status:
          type: string
          enum:
            - completed
            - failed
      required:
        - type
        - call_id
        - name
        - arguments
    ResponseInputFunctionCallOutput:
      title: Response Input Function Call Output
      type: object
      properties:
        type:
          type: string
          enum:
            - function_call_output
        call_id:
          type: string
          description: The call_id of the function_call this output corresponds to.
        output:
          type: string
          description: JSON string of the function result.
      required:
        - type
        - call_id
        - output
    ResponseFormatText:
      title: ResponseFormatText
      type: object
      description: Specifies that the model should produce output as plain text.
      additionalProperties: true
      properties:
        type:
          const: text
          enum:
            - text
          title: Type
          type: string
      required:
        - type
    ResponseFormatJSONObject:
      title: ResponseFormatJSONObject
      type: object
      description: Specifies that the model should produce output as a raw JSON object.
      additionalProperties: true
      properties:
        type:
          const: json_object
          enum:
            - json_object
          title: Type
          type: string
      required:
        - type
      example:
        type: json_object
    ResponseFormatJSONSchema:
      title: ResponseFormatJSONSchema
      type: object
      additionalProperties: true
      description: >-
        Specifies that the model should produce output conforming to a given
        JSON schema.
      properties:
        json_schema:
          $ref: '#/components/schemas/JSONSchema'
        type:
          const: json_schema
          enum:
            - json_schema
          title: Type
          type: string
      required:
        - json_schema
        - type
      example:
        type: json_schema
        json_schema:
          name: User
          description: JSON schema for a simple user object
          strict: false
          schema:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the user
              name:
                type: string
                description: Full name of the user
            required:
              - id
              - name
    ResponseMessage:
      title: Response Message
      type: object
      properties:
        type:
          type: string
          enum:
            - message
        id:
          type: string
          description: Unique identifier for this message.
        role:
          type: string
          enum:
            - assistant
        status:
          type: string
          enum:
            - completed
            - in_progress
        content:
          type: array
          items:
            $ref: '#/components/schemas/ResponseContentPart'
      required:
        - type
        - id
        - role
        - content
    ResponseFunctionCall:
      title: Response Function Call
      type: object
      properties:
        type:
          type: string
          enum:
            - function_call
        id:
          type: string
          description: Unique identifier for this function call.
        call_id:
          type: string
          description: Call ID for matching with function_call_output.
        name:
          type: string
          description: Name of the function to call.
        arguments:
          type: string
          description: JSON string of function arguments.
        status:
          type: string
          enum:
            - completed
            - in_progress
      required:
        - type
        - id
        - call_id
        - name
        - arguments
    ResponseOutputReasoning:
      title: Response Output Reasoning
      type: object
      properties:
        type:
          type: string
          enum:
            - reasoning
        id:
          type: string
          description: Unique identifier for this reasoning item.
        status:
          type: string
          enum:
            - completed
            - in_progress
        summary:
          type: array
          items:
            type: object
        content:
          type: array
          items:
            $ref: '#/components/schemas/ResponseReasoningText'
      required:
        - type
        - id
        - content
    ResponseContentPart:
      title: Response Content Part
      description: A content part within a response output item.
      oneOf:
        - $ref: '#/components/schemas/ResponseOutputText'
        - $ref: '#/components/schemas/ResponseReasoningText'
    JSONSchema:
      title: JSONSchema
      type: object
      additionalProperties: true
      description: >-
        A JSON Schema definition the model's structured output. Follows standard
        JSON Schema syntax.
      properties:
        description:
          type: string
          title: Description
          description: description the json schema
          nullable: true
        name:
          title: Name
          type: string
          description: name of the object schema
        schema:
          type: object
          title: Schema
          description: Actual json schema object
          nullable: true
        strict:
          type: boolean
          title: Strict
          description: whether or not to do an strict validation of the schema
          nullable: true
          default: false
      required:
        - name
    ResponseReasoningText:
      title: Response Reasoning Text
      type: object
      properties:
        type:
          type: string
          enum:
            - reasoning_text
        text:
          type: string
          description: The reasoning text content.
      required:
        - type
        - text
    ResponseOutputText:
      title: Response Output Text
      type: object
      properties:
        type:
          type: string
          enum:
            - output_text
        text:
          type: string
          description: The text content.
        annotations:
          type: array
          items:
            type: object
          nullable: true
        logprobs:
          type: array
          items:
            type: object
          nullable: true
      required:
        - type
        - text
  headers:
    InferenceId:
      description: >-
        Unique identifier for this inference request, useful for debugging and
        support.
      schema:
        type: string
        example: a0b08d8a-1893-45d6-a0f4-7ad6fdeb5443
    RateLimitRequests:
      description: Maximum requests allowed per minute.
      schema:
        type: integer
        example: 250
    RateLimitRequestsDay:
      description: Maximum requests allowed per day.
      schema:
        type: integer
        example: 50000
    RateLimitRemainingRequests:
      description: Remaining requests in the current minute window.
      schema:
        type: integer
        example: 247
    RateLimitRemainingRequestsDay:
      description: Remaining requests in the current day.
      schema:
        type: integer
        example: 49988
    RateLimitResetRequests:
      description: Unix timestamp when the per-minute limit resets.
      schema:
        type: integer
        example: 1776937132
    RateLimitResetRequestsDay:
      description: Unix timestamp when the daily limit resets.
      schema:
        type: integer
        example: 1777023472
  securitySchemes:
    api_key:
      type: http
      description: Infercom API Key
      scheme: bearer
      bearerFormat: apiKey

````