Skip to content
kenari.

Responses (OpenAI agent wire)

The POST /v1/responses endpoint is compatible with the OpenAI Responses API: a stateless subset for coding-agent clients such as Codex CLI (wire_api = "responses"). Recent Codex CLI versions no longer have a chat wire (wire_api = "chat" hard-errors since around version 0.140), so this endpoint is the way to use Codex through kenari.

kenari does not store responses server-side: there is no chaining via previous_response_id. The store field is accepted but ignored (always behaves as store: false). If previous_response_id is set to anything other than null, the request is rejected with a 400 status and a clear message, so a client does not mistakenly assume a continuation that never actually happens.

Required fields: model and input.

FieldTypeDescription
modelstringRequired. Model id, for example gpt-5-5.
inputarrayRequired. List of conversation items: message (role developer/user/assistant), function_call, function_call_output.
instructionsstringOptional. Top-level system/developer instructions, folded into the system prompt.
toolsarrayOptional. FLAT top-level function tool declarations (not nested like the chat wire). Other tool types (namespace, web_search, etc.) are silently dropped in v1.
tool_choicestring/objectOptional. "auto", "none", "required", or {"type": "function", "name": "..."}.
reasoningobjectOptional. `{“effort”: “low”
max_output_tokensintegerOptional. Limit for generated tokens.
temperaturenumberOptional.
top_pnumberOptional.
streambooleanOptional. Enable streaming.
storebooleanOptional. Accepted, ignored.
previous_response_idstring/nullOptional. Must be null or absent. Any other value is rejected with 400.
{
"id": "resp_...",
"object": "response",
"created_at": 1730000000,
"status": "completed",
"model": "gpt-5-5",
"output": [
{"type": "message", "id": "msg_1", "role": "assistant", "content": [
{"type": "output_text", "text": "Hi! How can I help?"}
]}
],
"usage": {
"input_tokens": 9,
"output_tokens": 12,
"total_tokens": 21,
"input_tokens_details": {"cached_tokens": 0}
}
}

A function tool call appears as a function_call item (with call_id, name, and a JSON-string arguments) in the output array, before or after a message item in real emission order.

~/.codex/config.toml
model = "gpt-5-5"
model_provider = "kenari"
[model_providers.kenari]
name = "kenari"
base_url = "https://kenari.id/v1"
wire_api = "responses"
env_key = "KENARI_API_KEY"
requires_openai_auth = false
Terminal window
export KENARI_API_KEY=kn-...
codex

Set "stream": true to receive the response gradually as Responses-style server-sent events (response.created, response.output_item.added, response.reasoning_summary_part.added, response.reasoning_summary_text.delta, response.reasoning_summary_text.done, response.reasoning_summary_part.done, response.output_text.delta / response.function_call_arguments.delta, response.function_call_arguments.done, response.output_item.done, response.completed, response.failed). For reasoning models, the reasoning summary streams via the response.reasoning_summary_* events as one reasoning output item before the answer. General event format details are in Streaming.