Responses
POST https://api.inferam.ai/v1/responses is OpenAI’s Responses format, which Codex uses. Inferam translates it to the model server’s Chat Completions format and back, including streaming events.
curl https://api.inferam.ai/v1/responses \ -H "Authorization: Bearer $INFERAM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "DeepSeek-V4.1-Flash-1017", "instructions": "You are a terse senior engineer.", "input": "Explain Rust lifetimes in two sentences.", "reasoning": {"effort": "low"} }'Supported fields
Section titled “Supported fields”model, input (a string or a list of items), instructions, stream, max_output_tokens, temperature, top_p, tools, tool_choice, text.format (json_object, json_schema) and reasoning.effort.
- Input items:
message(rolesuser,assistant,system,developer),reasoning,function_call,function_call_output,custom_tool_callandcustom_tool_call_output. - Content parts:
input_text,output_textandinput_imagewith a base64data:URL. - Tools:
functiontools, pluscustom(freeform) tools such as Codex’sapply_patch. Hosted tools (web_search,file_search,computer_use,local_shell, …) can’t run on Inferam and are dropped from the request.
Stateless only
Section titled “Stateless only”Inferam keeps no conversation state. store is always false, and a request with previous_response_id gets a 400. Send the whole conversation in input, as Codex does. Include the reasoning items from earlier turns: the model expects its own reasoning back on tool-calling turns.
Reasoning
Section titled “Reasoning”reasoning.effort takes none (thinking off), minimal, low, medium, high, xhigh or max. The model’s reasoning comes back as a reasoning output item with the text in content (reasoning_text). When streaming, it arrives as response.reasoning_summary_text.delta events. usage.output_tokens_details.reasoning_tokens is always reported as 0; reasoning is counted in output_tokens.
Streaming
Section titled “Streaming”With "stream": true you get the standard event sequence: response.created, response.in_progress, the output item, content and function-call argument events, then response.completed. If the output limit is reached, the stream ends with response.incomplete instead. A failure after streaming has started ends with response.failed.
"usage": { "input_tokens": 2048, "input_tokens_details": { "cached_tokens": 1792 }, "output_tokens": 312, "output_tokens_details": { "reasoning_tokens": 0 }, "total_tokens": 2360}