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.
Stateless
Section titled “Stateless”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.
Request
Section titled “Request”Required fields: model and input.
| Field | Type | Description |
|---|---|---|
model | string | Required. Model id, for example gpt-5-5. |
input | array | Required. List of conversation items: message (role developer/user/assistant), function_call, function_call_output. |
instructions | string | Optional. Top-level system/developer instructions, folded into the system prompt. |
tools | array | Optional. 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_choice | string/object | Optional. "auto", "none", "required", or {"type": "function", "name": "..."}. |
reasoning | object | Optional. `{“effort”: “low” |
max_output_tokens | integer | Optional. Limit for generated tokens. |
temperature | number | Optional. |
top_p | number | Optional. |
stream | boolean | Optional. Enable streaming. |
store | boolean | Optional. Accepted, ignored. |
previous_response_id | string/null | Optional. Must be null or absent. Any other value is rejected with 400. |
Response
Section titled “Response”{ "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 CLI
Section titled “Codex CLI”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 = falseexport KENARI_API_KEY=kn-...codexStreaming
Section titled “Streaming”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.