An endpoint compatible with the OpenAI Responses API, for recent versions of Codex CLI and client.responses.create() in the OpenAI SDK. Set the base URL to https://api.goiapi.com/v1 and use your API key. Every model on Models can be called through this endpoint, including models not made by OpenAI.
POST https://api.goiapi.com/v1/responsesBody
model and input are required. input is a string, or a list of messages and items like the ones Codex sends.
curl https://api.goiapi.com/v1/responses \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-5-5",
"instructions": "Answer briefly",
"input": "Write a Python function that reverses a string",
"max_output_tokens": 1024
}'Set max_output_tokens: funds are reserved based on this value before the model is called. See Limits and balance.
Supported
instructions, andinputas a string or a list:user,assistant,systemanddevelopermessages withinput_text,output_text,input_image(URL or base64) andinput_file(base64) content.- Tool calling:
toolsof typefunctionandcustom(such as Codex'sapply_patch),tool_choice,parallel_tool_calls;function_call,function_call_output,custom_tool_callandcustom_tool_call_outputitems ininput. reasoning.effort; the reasoning the model returns is in thereasoningitem (summaryfield).max_output_tokens,temperature,top_p,text.format(json_object,json_schema),prompt_cache_key.- Streaming (
"stream": true): the eventsresponse.created,response.output_item.added,response.output_text.delta,response.function_call_arguments.delta,response.reasoning_summary_text.delta,response.output_item.done, thenresponse.completed(orresponse.incompletewhenmax_output_tokensis reached). usagein the Responses format (input_tokens,output_tokens,input_tokens_details.cached_tokens, and so on).
Not supported
Responses are not stored, so every call must include the full conversation in input (Codex CLI already does this).
previous_response_id,conversation,prompt,background: trueanditem_referenceitems: return a400error.- OpenAI built-in tools (
web_search,file_search,local_shell,code_interpreter,computer_use,mcp,image_generation): ignored; the model does not see them. reasoningitems sent back ininput, andencrypted_content: ignored.- Images or files referenced by
file_id: return a400error. Send a URL or base64 data instead. GET /v1/responses/{id}, and cancelling or deleting responses.
Errors
Errors that occur before the response starts use the standard OpenAI error format (see Error codes). Once the stream has started, errors arrive as a response.failed event:
event: response.failed
data: {"type":"response.failed","response":{"status":"failed","error":{"code":"service_unavailable","message":"…"},…}}Billing
You pay for the tokens the model actually uses, the same as with /v1/chat/completions. If you disconnect midway, you are charged for the tokens used up to that point (input plus the output generated so far), subject to the minimum charge per request. A failed request that returns no content is not charged, except a request you cancel yourself. Details are in the Refund Policy.