LM-Kit OneDocs2026.8.10lm-kit.com
API Compatibility

OpenAI · Responses

Generates a model response using the OpenAI Responses API shape.#

POST/v1/responses

OpenAI 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 ·

PropertyTypeDescription
modelstring

Model identifier. Empty selects the server's default chat model.

inputone of object ·
instructionsstring

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_choiceobject

How the model chooses tools: "auto", "none", "required", or {"type":"function","name":...}.

parallel_tool_callsboolean

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.

storeboolean

Whether to persist the response for later retrieval via GET /v1/responses/. Defaults to true.

previous_response_idstring

Chains this request onto a stored response. Not supported yet: requests carrying it are refused rather than served with a silently truncated context.

conversationone of object ·
backgroundboolean

Background execution. Not supported yet; refused when true.

includestring[]

Extra payload includes. Unknown values are accepted and ignored.

truncationstring

Context overflow policy: "disabled" (default) or "auto".

max_output_tokensobject (int32)

Upper bound on generated tokens, reasoning included.

temperatureobject (double)

Sampling temperature. 0 selects greedy decoding.

top_pobject (double)

Nucleus sampling threshold.

metadataobject

Caller-defined key/value pairs echoed back and stored with the response.

streamboolean

When true, the response streams as named server-sent events.

Responses

StatusTypeDescription
200

OK

400

Bad Request

404

Not Found

500application/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.#

GET/v1/responses/{responseId}

Parameters

NameInTypeDescription
responseIdrequiredpathstring

The response identifier (resp_...).

Responses

StatusTypeDescription
200

OK

404

Not Found

curl -X GET "$LMKIT_ONE_URL/v1/responses/$RESPONSEID" \
  -H "Authorization: Bearer $LMKIT_API_KEY"

Deletes a stored response.#

DELETE/v1/responses/{responseId}

Parameters

NameInTypeDescription
responseIdrequiredpathstring

The response identifier (resp_...).

Responses

StatusTypeDescription
200application/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.#

GET/v1/responses/{responseId}/input_items

Returns 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

NameInTypeDescription
responseIdrequiredpathstring

The response identifier (resp_...).

orderquerystring

Sort order by insertion position: asc or desc (default).

afterquerystring

Item id cursor: return items after this one.

limitqueryobject (int32)

Page size, 1-100 (default 20).

Responses

StatusTypeDescription
200application/json

OK

404

Not Found

curl -X GET "$LMKIT_ONE_URL/v1/responses/$RESPONSEID/input_items" \
  -H "Authorization: Bearer $LMKIT_API_KEY"