Skip to main content
POST
/
responses
JavaScript
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);
{
  "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
}

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.

Authorizations

Authorization
string
header
required

Infercom API Key

Body

application/json

Response creation parameters

Request body for creating a model response.

model
string
required

The model ID to use (e.g., MiniMax-M2.5, gpt-oss-120b).

Example:

"MiniMax-M2.5"

input
required

Plain text input (equivalent to a user message).

instructions
string | null

System message prepended to input.

stream
boolean
default:false

If true, stream response as Server-Sent Events.

max_output_tokens
integer | null

Maximum tokens to generate.

temperature
number
default:0.7

Randomness control (0-2).

Required range: 0 <= x <= 2
top_p
number
default:1

Nucleus sampling cutoff (0-1).

Required range: 0 <= x <= 1
top_k
integer | null

Top-K sampling (1-100).

Required range: 1 <= x <= 100
tools
Response Tool · object[] | null

Function tools available to the model (max 128).

Maximum array length: 128
tool_choice

Controls how the model uses tools.

Available options:
none,
auto,
required
parallel_tool_calls
boolean
default:true

Allow multiple tool calls in parallel.

text
Text · object

Response format configuration.

reasoning
Reasoning · object

Reasoning configuration for supported models.

user
string | null

User identifier (echoed in response).

Response

Successful response. Returns a ResponseResponse object (non-streaming), or a stream of Server-Sent Events (when stream: true).

Response object from POST /responses.

id
string
required

Unique response identifier.

object
enum<string>
required

Object type, always "response".

Available options:
response
status
enum<string>
required

Response lifecycle status.

Available options:
completed,
failed,
in_progress,
incomplete
created_at
integer
required

Unix timestamp when created.

model
string
required

Model ID used.

output
(Response Message · object | Response Function Call · object | Response Output Reasoning · object)[]
required

Output items (messages, reasoning, function calls).

An output item in the response (message, reasoning, or function_call).

completed_at
integer | null

Unix timestamp when completed.

usage
Response Usage · object

Token usage statistics for the response.

error
object

Error details when status is "failed".

instructions
string | null

Echoed system instructions.

temperature
number | null
top_p
number | null
tools
Response Tool · object[]
tool_choice

Controls how the model uses tools.

Available options:
none,
auto,
required
parallel_tool_calls
boolean
text
object
reasoning
object
store
boolean

Always false (stateless API).

service_tier
string | null