Responses
Create a model response
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);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.7", input="Explain supervised vs unsupervised learning.",)
print(response.output_text)curl -X POST https://api.infercom.ai/v1/responses \ -H "Authorization: Bearer $INFERCOM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "MiniMax-M2.7", "input": "Explain supervised vs unsupervised learning." }'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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Response creation parameters
Request body for creating a model response.
object
The model ID to use (e.g., MiniMax-M2.7, gpt-oss-120b).
Example
MiniMax-M2.7Plain text input (equivalent to a user message).
Ordered list of input items (messages, tool calls, tool results).
object
The role of the message author.
object
The text content.
object
object
object
The reasoning text content.
object
Unique identifier for this function call.
Call ID for matching with function_call_output.
Name of the function.
JSON string of function arguments.
object
The call_id of the function_call this output corresponds to.
JSON string of the function result.
System message prepended to input.
If true, stream response as Server-Sent Events.
Maximum tokens to generate.
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.
Example
1Nucleus sampling cutoff (0-1).
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.
Function tools available to the model (max 128).
A function tool definition for the Responses API.
object
Tool type. Only “function” is supported.
The name of the function.
A description of what the function does.
JSON Schema describing the function parameters.
object
Whether to enforce strict schema validation.
Allow multiple tool calls in parallel.
Response format configuration.
object
Specifies that the model should produce output as plain text.
object
Specifies that the model should produce output as a raw JSON object.
object
Example
{ "type": "json_object"}Specifies that the model should produce output conforming to a given JSON schema.
object
A JSON Schema definition the model’s structured output. Follows standard JSON Schema syntax.
object
Description the json schema
Name of the object schema
Actual json schema object
object
Whether or not to do an strict validation of the schema
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" ] } }}Reasoning configuration for supported models.
object
Reasoning depth level.
User identifier (echoed in response).
Responses
Section titled “Responses”Successful response. Returns a ResponseResponse object (non-streaming), or a stream of Server-Sent Events (when stream: true).
Response object from POST /responses.
object
Unique response identifier.
Object type, always “response”.
Response lifecycle status.
Unix timestamp when created.
Unix timestamp when completed.
Model ID used.
Output items (messages, reasoning, function calls).
object
Unique identifier for this message.
object
The text content.
object
object
object
The reasoning text content.
object
Unique identifier for this function call.
Call ID for matching with function_call_output.
Name of the function to call.
JSON string of function arguments.
object
Unique identifier for this reasoning item.
object
object
The reasoning text content.
Token usage statistics for the response.
object
Number of input tokens.
Number of output tokens generated.
Total tokens (input + output).
object
Tokens served from cache.
object
Tokens used for reasoning.
Time to first token in seconds.
Total generation time in seconds.
Output throughput (tokens/second).
Error details when status is “failed”.
object
Echoed system instructions.
A function tool definition for the Responses API.
object
Tool type. Only “function” is supported.
The name of the function.
A description of what the function does.
JSON Schema describing the function parameters.
object
Whether to enforce strict schema validation.
object
Specifies that the model should produce output as plain text.
object
Specifies that the model should produce output as a raw JSON object.
object
Specifies that the model should produce output conforming to a given JSON schema.
object
A JSON Schema definition the model’s structured output. Follows standard JSON Schema syntax.
object
Description the json schema
Name of the object schema
Actual json schema object
object
Whether or not to do an strict validation of the schema
object
Always false (stateless API).
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}Headers
Section titled “Headers”Example
a0b08d8a-1893-45d6-a0f4-7ad6fdeb5443Unique identifier for this inference request, useful for debugging and support.
Example
250Maximum requests allowed per minute.
Example
50000Maximum requests allowed per day.
Example
247Remaining requests in the current minute window.
Example
49988Remaining requests in the current day.
Example
1776937132Unix timestamp when the per-minute limit resets.
Example
1777023472Unix timestamp when the daily limit resets.
Bad Request - Missing or invalid parameters
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examples
Required field missing
{ "error": { "message": "Missing required field: 'input'.", "type": "invalid_request_error", "param": "input", "code": "missing_required_field" }}Model not supported for Responses API
{ "error": { "message": "Unsupported model DeepSeek-V3.1 on Response API", "type": "invalid_request_error", "code": "unsupported_model" }}Built-in tools not supported
{ "error": { "message": "built-in/server-side tools are not supported; only \"function\" type tools are accepted", "type": "invalid_request_error", "code": "unsupported_tool_type" }}Unauthorized - Invalid or missing API key
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Not found - Model does not exist
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
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.
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
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
Other kind of errors
object
object
Error code
Error message
Error params
Error type
Unique identifier for the request. Quote it in any support report. Absent on the two responses that use the flat error shape.
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Internal Server Error