Skip to content
InfercomInfercomInfercom Documentation

Responses

Create a model response

POST
/responses
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.7',
input: 'Explain supervised vs unsupervised learning.',
});
console.log(response.output_text);

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.

Response creation parameters

Media typeapplication/json
Response Request

Request body for creating a model response.

object
model
required
Model

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

string
Example
MiniMax-M2.7
input
required
One of:

Plain text input (equivalent to a user message).

string
instructions
Instructions

System message prepended to input.

string
nullable
stream
Stream

If true, stream response as Server-Sent Events.

boolean
max_output_tokens
Max Output Tokens

Maximum tokens to generate.

integer
nullable
temperature
Temperature

Randomness control (0-2). No default: omitting this parameter makes most models decode greedily, which behaves like temperature 0. Set it explicitly. See Recommended sampling parameters.

number
<= 2
Example
1
top_p
Top P

Nucleus sampling cutoff (0-1).

number
<= 1
top_k
Top K

Top-K sampling. Send 1 or greater. top_k has no effect unless temperature is 0.001 or above - below that, including when temperature is omitted, it is forced to 1 and decoding is greedy. When omitted, top_k is 1048576, which is effectively unrestricted. No upper bound is enforced. Note that this endpoint does not validate the lower bound: -1 and 0 return a 200 here but a 400 on /chat/completions and /messages, and they do not mean “unrestricted” on any endpoint.

integer
nullable >= 1
tools
Tools

Function tools available to the model (max 128).

Array<object>
nullable <= 128 items
Response Tool

A function tool definition for the Responses API.

object
type
required

Tool type. Only “function” is supported.

string
Allowed values: function
name
required

The name of the function.

string
description

A description of what the function does.

string
parameters

JSON Schema describing the function parameters.

object
strict

Whether to enforce strict schema validation.

boolean
nullable
tool_choice
One of:
string
Allowed values: none auto required
parallel_tool_calls
Parallel Tool Calls

Allow multiple tool calls in parallel.

boolean
default: true
text
Text

Response format configuration.

object
format
One of:
ResponseFormatText

Specifies that the model should produce output as plain text.

object
type
required
Type
string
Allowed value: text
Allowed values: text
key
additional properties
any
reasoning
Reasoning

Reasoning configuration for supported models.

object
effort

Reasoning depth level.

string
default: medium
Allowed values: low medium high
user
User

User identifier (echoed in response).

string
nullable

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

Media typeapplication/json
Response Response

Response object from POST /responses.

object
id
required

Unique response identifier.

string
object
required

Object type, always “response”.

string
Allowed values: response
status
required

Response lifecycle status.

string
Allowed values: completed failed in_progress incomplete
created_at
required

Unix timestamp when created.

integer
completed_at

Unix timestamp when completed.

integer
nullable
model
required

Model ID used.

string
output
required

Output items (messages, reasoning, function calls).

Array
One of: discriminator: type
Response Message
object
type
required
string
Allowed values: message
id
required

Unique identifier for this message.

string
role
required
string
Allowed values: assistant
status
string
Allowed values: completed in_progress
content
required
Array
One of:
Response Output Text
object
type
required
string
Allowed values: output_text
text
required

The text content.

string
annotations
Array<object>
nullable
object
logprobs
Array<object>
nullable
object
usage
Response Usage

Token usage statistics for the response.

object
input_tokens
required

Number of input tokens.

integer
output_tokens
required

Number of output tokens generated.

integer
total_tokens
required

Total tokens (input + output).

integer
input_tokens_details
object
cached_tokens

Tokens served from cache.

integer
output_tokens_details
object
reasoning_tokens

Tokens used for reasoning.

integer
time_to_first_token

Time to first token in seconds.

number
nullable
total_latency

Total generation time in seconds.

number
nullable
output_tokens_per_sec

Output throughput (tokens/second).

number
nullable
error

Error details when status is “failed”.

object
code
string
message
string
instructions

Echoed system instructions.

string
nullable
temperature
number
nullable
top_p
number
nullable
tools
Array<object>
Response Tool

A function tool definition for the Responses API.

object
type
required

Tool type. Only “function” is supported.

string
Allowed values: function
name
required

The name of the function.

string
description

A description of what the function does.

string
parameters

JSON Schema describing the function parameters.

object
strict

Whether to enforce strict schema validation.

boolean
nullable
tool_choice
One of:
string
Allowed values: none auto required
parallel_tool_calls
boolean
text
object
format
One of:
ResponseFormatText

Specifies that the model should produce output as plain text.

object
type
required
Type
string
Allowed value: text
Allowed values: text
key
additional properties
any
reasoning
object
effort
string
nullable
Allowed values: low medium high
summary
string
nullable
store

Always false (stateless API).

boolean
service_tier
string
nullable
Example
{
"id": "resp_abc123",
"object": "response",
"status": "completed",
"created_at": 1778845598,
"completed_at": 1778845598,
"model": "MiniMax-M2.7",
"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
}
inference-id
string
Example
a0b08d8a-1893-45d6-a0f4-7ad6fdeb5443

Unique identifier for this inference request, useful for debugging and support.

x-ratelimit-limit-requests
integer
Example
250

Maximum requests allowed per minute.

x-ratelimit-limit-requests-day
integer
Example
50000

Maximum requests allowed per day.

x-ratelimit-remaining-requests
integer
Example
247

Remaining requests in the current minute window.

x-ratelimit-remaining-requests-day
integer
Example
49988

Remaining requests in the current day.

x-ratelimit-reset-requests
integer
Example
1776937132

Unix timestamp when the per-minute limit resets.

x-ratelimit-reset-requests-day
integer
Example
1777023472

Unix timestamp when the daily limit resets.

Bad Request - Missing or invalid parameters

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examples

Required field missing

{
"error": {
"message": "Missing required field: 'input'.",
"type": "invalid_request_error",
"param": "input",
"code": "missing_required_field"
}
}

Unauthorized - Invalid or missing API key

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Not found - Model does not exist

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Gone - the model has been deprecated and removed. Returns the envelope, but with type and code both set to internal_error rather than model_deprecated. The condition is permanent despite that type - change the model ID rather than retrying.

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Example
{
"error": {
"code": "internal_error",
"message": "The requested model (MiniMax-M2.5) is not available on SambaNova Cloud.",
"param": null,
"type": "internal_error"
},
"request_id": "d95bc20b79214a2fb7bbd8fe1712754c"
}

Too Many Requests - Rate limit exceeded

Media typeapplication/json
GeneralError

Other kind of errors

object
error
required
object
code
code

Error code

string
nullable
message
message

Error message

string
param
param

Error params

string
nullable
type
type

Error type

string
request_id
request_id

Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"param": "example",
"type": "example"
},
"request_id": "example"
}

Internal Server Error

Media typetext/plain
string