OpenAI · Responses
Generates a model response using the OpenAI Responses API shape.#
/v1/responsesOpenAI Responses API endpoint, the wire protocol the newest agentic clients speak (Codex-class tools configure wire_api = "responses" and a base_url pointing here).
Served in this version: string and item-array input (messages with input_text, input_image by data URL, http(s) URL or uploaded file_id, input_file by file_id or file_data with document text folded into context, function_call, function_call_output, reasoning passthrough), previous_response_id chaining against stored responses (instructions are not inherited, matching the upstream contract), instructions, flat function tools with tool_choice, the file_search tool against this server's vector stores, structured output through text.format (json_object and json_schema are enforced with grammar-constrained decoding), reasoning output items with real reasoning text on thinking models, usage with a reasoning-token breakdown, and response storage: store defaults to true, GET retrieves, DELETE removes, and GET //input_items lists a stored response's input.
Streaming follows the documented event scaffold with a monotonic sequence_number: response.created, response.in_progress, response.output_item.added, response.content_part.added, response.output_text.delta*, response.output_text.done, response.content_part.done, response.output_item.done, response.completed.
Not served yet, refused by name rather than silently misinterpreted: conversation objects, background execution, hosted tool types other than file_search, and item_reference.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | Model identifier. Empty selects the server's default chat model. |
input | one of object · | |
instructions | string | A system (developer) message inserted at the start of the model's context. |
tools | [] | Tools the model may call. Function tools use the Responses API's flat format: type, name, description, parameters, strict. |
tool_choice | object | How the model chooses tools: "auto", "none", "required", or {"type":"function","name":...}. |
parallel_tool_calls | boolean | Whether the model may emit several tool calls in one turn. |
text | Output text configuration; text.format carries the structured-output contract (json_schema is enforced with grammar-constrained decoding). | |
reasoning | Reasoning configuration for thinking models: effort (none/minimal/low/medium/high/xhigh/max) and summary. | |
store | boolean | Whether to persist the response for later retrieval via GET /v1/responses/. Defaults to true. |
previous_response_id | string | Chains this request onto a stored response. Not supported yet: requests carrying it are refused rather than served with a silently truncated context. |
conversation | one of object · | |
background | boolean | Background execution. Not supported yet; refused when true. |
include | string[] | Extra payload includes. Unknown values are accepted and ignored. |
truncation | string | Context overflow policy: "disabled" (default) or "auto". |
max_output_tokens | object (int32) | Upper bound on generated tokens, reasoning included. |
temperature | object (double) | Sampling temperature. 0 selects greedy decoding. |
top_p | object (double) | Nucleus sampling threshold. |
metadata | object | Caller-defined key/value pairs echoed back and stored with the response. |
stream | boolean | When true, the response streams as named server-sent events. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/v1/responses" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"instructions": "string",
"tools": [
{
"type": "string",
"name": "string",
"description": "string",
"strict": false
}
],
"tool_choice": {}
}'Retrieves a stored response.#
/v1/responses/{responseId}Parameters
| Name | In | Type | Description |
|---|---|---|---|
responseIdrequired | path | string | The response identifier (resp_...). |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/v1/responses/$RESPONSEID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Deletes a stored response.#
/v1/responses/{responseId}Parameters
| Name | In | Type | Description |
|---|---|---|---|
responseIdrequired | path | string | The response identifier (resp_...). |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X DELETE "$LMKIT_ONE_URL/v1/responses/$RESPONSEID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Lists the input items of a stored response.#
/v1/responses/{responseId}/input_itemsReturns the effective input the stored response was generated from (a chained prelude already expanded), newest first by default. 'order' (asc|desc), 'after' (item id cursor) and 'limit' (1-100, default 20) page the list.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
responseIdrequired | path | string | The response identifier (resp_...). |
order | query | string | Sort order by insertion position: asc or desc (default). |
after | query | string | Item id cursor: return items after this one. |
limit | query | object (int32) | Page size, 1-100 (default 20). |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/v1/responses/$RESPONSEID/input_items" \
-H "Authorization: Bearer $LMKIT_API_KEY"