Agents
Lists the pending approvals of the caller's agent runs, newest first.#
/lmkit/v1/approvalsEach approval is one tool call a run stopped on: the tool, the exact arguments the agent produced and their hash, its risk, the run and the input it works on, and when the approval expires. Decide with POST approvals//approve or /deny. The key must hold the approver grant; the key that started a run never decides its calls unless the tools policy allows self-approval.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | object (int32) |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/approvals" \
-H "Authorization: Bearer $LMKIT_API_KEY"Approves a pending tool call; with edited_arguments, approves it with corrected arguments.#
/lmkit/v1/approvals/{id}/approveParameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
arguments_hash | string | |
reason | string | |
edited_arguments | one of object · |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 403 | Forbidden | |
| 404 | Not Found | |
| 409 | Conflict |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/approvals/$ID/approve" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"arguments_hash": "string",
"reason": "string"
}'Denies a pending tool call: it never runs, and the agent is told the reason.#
/lmkit/v1/approvals/{id}/denyParameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
arguments_hash | string | |
reason | string | |
edited_arguments | one of object · |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 403 | Forbidden | |
| 404 | Not Found | |
| 409 | Conflict |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/approvals/$ID/deny" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"arguments_hash": "string",
"reason": "string"
}'Streams the document a review approval asks to review.#
/lmkit/v1/approvals/{id}/documentFor a document_review approval: the stored file or the file under the server's ingest roots that the review gate names, so the reviewer reads it before deciding. 404 when the approval names no readable document.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/approvals/$ID/document" \
-H "Authorization: Bearer $LMKIT_API_KEY"Chats with a published agent: one JSON result or a stream, with an optional session the server keeps.#
/lmkit/v1/agents/{name}/chatThe native chat contract (see POST /lmkit/v1/chat) with the agent named by the path: its published revision answers (agent_revision pins another), with its instructions, knowledge, tools, model and tool budget. 'input' is the user's message. 'new_session' starts a session the server keeps and returns its 'session_id'; sending it back continues the conversation, so the caller sends only its next message. A session belongs to the key owner that started it and is forgotten after 24 hours without a message.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string | The published agent. |
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
input | string | The user's message; appended to 'messages' when both are given. |
session_id | string | Continues a session the server keeps: the earlier turns are prepended, the new ones recorded. Returned by a request that set 'new_session'. |
new_session | boolean | Starts a session the server keeps; its id comes back in 'session_id' (and the X-LMKit-Session header when streaming). |
model | string | Catalog model ID; blank uses the server's default chat model. |
system | string | Optional system prompt prepended to the conversation. |
messages | [] | The conversation so far, ending with the user message to answer. Roles: system, user, assistant. |
temperature | object (float) | Sampling temperature. 0 selects greedy decoding. |
top_p | object (float) | Nucleus sampling cutoff: only tokens within this cumulative probability mass are considered. 1 disables the cutoff. |
top_k | object (int32) | Top-K sampling cutoff: only the K most likely tokens are considered. Absent keeps the sampler's default. |
min_p | object (float) | Minimum probability cutoff relative to the most likely token. Absent keeps the sampler's default. |
seed | object (uint32) | Sampling seed for reproducible generation. Absent samples freely. |
max_tokens | object (int32) | Upper bound on the completion length, in tokens. |
n | object (int32) | How many alternative completions to generate: 1 (default) to 8. Alternatives decode sequentially over one prompt read; with a seed, alternative i samples from seed + i (replay is best-effort, as for any seeded pooled decode). Not combinable with tools or model-driven skills. Streaming deltas carry the alternative's index as 'i', and the terminal summary lists every alternative under 'choices'. |
logprobs | boolean | true returns the log probability of every generated token (thinking and tool channels included, in generation order) on the terminal summary. |
top_logprobs | object (int32) | 0 to 20: how many of the most likely alternatives to report at each position. A positive value implies logprobs. |
logit_bias | object | Per-token sampling bias, -100 (never) to 100 (always): keys are token ids ("8264") or plain text chunks ("Paris"), which the server maps onto the model's own vocabulary. The bias adds to the token's raw logit at every position. |
stop | string[] | Sequences that end the completion when generated. The matched sequence is not included in the answer. |
frequency_penalty | object (float) | Penalizes tokens by how often they already appeared, reducing repetition. 0 disables. |
presence_penalty | object (float) | Penalizes tokens that appeared at all, encouraging new topics. 0 disables. |
repeat_penalty | object (float) | Multiplicative repetition penalty over recent tokens. Absent keeps the sampler's default. |
reasoning | string | Reasoning effort for models with a thinking channel: none, low, medium, or high. 'none' disables thinking; absent keeps the model's default. |
response_format | Constrains the answer's shape: {type: 'text' | 'json_object'} or {type: 'json_schema', json_schema: {schema: }}. JSON modes are grammar-enforced during decoding, so a non-conforming answer cannot be produced. | |
tools | [] | Client-dispatched tools the model may call: name, description, and a JSON Schema for the arguments. A call ends the exchange with reason 'tool_calls'; send each result back as a 'tool' role message to continue. |
server_tools | string[] | Server-executed built-in tools the model may use, by name (e.g. web_search, calc_arithmetic): the server runs the tool and the exchange continues with its result. Only tools the server's Tools policy enables actually run; anything else is narrated as denied. Tool use streams as tool_use events and is summarized on the result as tool_events. |
tool_choice | one of object · | |
stream | boolean | true streams server-sent events (status, delta, skill, done, error); false returns one JSON result. |
request_id | string | Optional caller-generated identifier for this exchange, used to address it from side channels (e.g. skip-thinking). |
skill | string | Optional name of a server skill pinned for this exchange: its instructions ride the system turn. |
skills | string[] | Server skill names the model may discover and activate on its own through function calling. Empty or absent disables model-driven skills for this exchange. |
skill_inputs | object | Answers to the pinned skill's activation questions, keyed by each question's slug. Unanswered questions fall back to their declared defaults. |
memory | string | Optional agent-memory id: facts extracted from this exchange persist under this id, and facts stored earlier under it are recalled as hidden context. The id is private to the API key's owner (and to the end user named by 'user'): another owner using the same id has a memory of its own. Requires the server's Memory feature; when it is off the exchange proceeds without memory. Letters, digits, dash, and underscore. |
user | string | Optional id of the end user this request is made for, as the calling application knows them (the same field as OpenAI's 'user'). Agent memory is then kept per end user within the API key's owner. The server trusts the authenticated key to state it. |
memory_store | string | Optional name of the memory STORE the memory id lives under: a server-defined policy bundle (recall depth, capacity, eviction, decay, extraction behavior). Absent uses the agent's store when an agent rides the request, else the default store. |
agent | string | Optional name of a server-defined agent: a reusable bundle (system prompt, skill, tools, memory intent) this exchange adopts. The bundle supplies defaults; any field the request states explicitly wins. A memory-intent bundle defaults 'memory' to the agent's own shared store, so the agent remembers across conversations unless the request scopes recall itself. An unknown name is a named refusal. |
agent_revision | object | LM-Kit extension. The revision of the agent this request runs: a published revision number, pinned so later publications do not change its behavior, or "draft" to preview the agent's draft (operators only). Absent runs the live revision. The response names the revision it ran. |
simulate_tools | boolean | LM-Kit extension. true previews the exchange without side effects: server tools that only read run for real, every tool that writes, sends or cannot be undone is answered with a simulated result and never executed, and agent memory is recalled but never taught. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 400 | Bad Request | |
| 401 | Unauthorized | |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/agents/$NAME/chat" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "string",
"session_id": "string",
"new_session": false,
"model": "string"
}'Lists the escalations of the caller's agent runs, newest first.#
/lmkit/v1/escalationsAn escalation is a run that ended handed_off: the agent's reason, summary, facts and evidence ids, the user's input, where it was delivered, and its status (open, taken, resolved). Filter with ?status=open.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
status | query | string | |
limit | query | object (int32) |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/escalations" \
-H "Authorization: Bearer $LMKIT_API_KEY"Marks one of the caller's escalations as taken by someone.#
/lmkit/v1/escalations/{runId}/takeParameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
by | string | |
note | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/escalations/$RUNID/take" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"by": "string",
"note": "string"
}'Marks one of the caller's escalations as resolved, with an optional note.#
/lmkit/v1/escalations/{runId}/resolveParameters
| Name | In | Type | Description |
|---|---|---|---|
runIdrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
by | string | |
note | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/escalations/$RUNID/resolve" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"by": "string",
"note": "string"
}'Starts a durable run of an agent on an input.#
/lmkit/v1/agents/{name}/runsThe run plays the agent as a chat request would (its instructions, tools under the calling key's grants, knowledge and memory), checkpointing as it goes. It answers when the run ends or stops: completed, failed, waiting for an approval (calls that need one stop the run instead of running), waiting for an answer to a question, or handed off to a person. With "background": true or Prefer: respond-async the call answers 202 at once and the run plays on; read it with GET runs/. The run keeps the agent revision it started on.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
input | string | |
user | string | |
memory | string | |
agent_revision | object | |
metadata | object | |
background | boolean |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/agents/$NAME/runs" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "string",
"user": "string",
"memory": "string",
"agent_revision": {}
}'Starts a durable run of a published workflow on an input.#
/lmkit/v1/workflows/{name}/runsThe run plays the workflow's steps in order: each agent step as a chat request would play that agent (tools under the calling key's grants, knowledge, memory), each tool step through the server's tools under the same grants. It is a run like any other: read, stream, continue and cancel it through runs/. A call that needs approval, an approval step or a question stops the whole workflow; a hand-off ends it in the escalations inbox. With "background": true or Prefer: respond-async the call answers 202 at once. The run keeps the workflow revision it started on.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
input | object | |
variables | object | |
user | string | |
memory | string | |
metadata | object | |
background | boolean |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/workflows/$NAME/runs" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {},
"variables": {},
"user": "string",
"memory": "string"
}'Reads one of the caller's runs.#
/lmkit/v1/runs/{id}Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/runs/$ID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Deletes one of the caller's ended runs now, with its checkpoint and everything that refers to it.#
/lmkit/v1/runs/{id}A run still in progress is a 409 (cancel it first), as is a run of a workflow under legal hold. Ended runs are otherwise deleted after the retention of the server or of their workflow.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found | |
| 409 | Conflict |
curl -X DELETE "$LMKIT_ONE_URL/lmkit/v1/runs/$ID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Lists the caller's runs, newest first.#
/lmkit/v1/runsParameters
| Name | In | Type | Description |
|---|---|---|---|
status | query | string | |
agent | query | string | |
limit | query | object (int32) |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/runs" \
-H "Authorization: Bearer $LMKIT_API_KEY"Streams one of the caller's runs as server-sent events: a status event each time the run changes, until it ends or stops.#
/lmkit/v1/runs/{id}/eventsParameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | text/event-stream | OK |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/runs/$ID/events" \
-H "Authorization: Bearer $LMKIT_API_KEY"Exports every run of the caller, one JSON run state per line.#
/lmkit/v1/runs/exportEach line is a run with its input, steps, answers and timeline, as GET runs/ reads it: the caller's own data, readable without the server.
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/x-ndjson | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/runs/export" \
-H "Authorization: Bearer $LMKIT_API_KEY"Cancels one of the caller's runs, on whichever node plays it.#
/lmkit/v1/runs/{id}/cancelParameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/runs/$ID/cancel" \
-H "Authorization: Bearer $LMKIT_API_KEY"Continues one of the caller's runs with what it waits for: decisions on its calls, the answer to its question, or the outcome of a write.#
/lmkit/v1/runs/{id}/inputA decision names the call and the arguments hash it was made on (both from the run's pending_approvals); a decision on other arguments or on a call that waits for nothing is refused. A denied call never runs and the agent is told why. Answers when the run ends or stops again, or at once (202) with "background": true.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
text | string | |
approvals | [] | |
reconciled | object | |
background | boolean |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 404 | Not Found | |
| 409 | Conflict |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/runs/$ID/input" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "string",
"approvals": [
{
"call_id": "string",
"arguments_hash": "string",
"approved": false,
"reason": "string"
}
],
"reconciled": {},
"background": false
}'Resumes one of the caller's failed workflow runs from its failing step.#
/lmkit/v1/runs/{id}/retryThe steps the run completed replay their recorded output and are never run again; the failing step is attempted afresh (its retry policy anew), with input corrected and variables set when given. A write whose outcome is unknown is settled by reconciled (call id: true when it happened, false when it did not); otherwise it is sent again only under the same idempotency key to a tool that honors keys, and the run waits for a person (awaiting_reconciliation) anywhere else. Answers 202 at once with the run queued; the first node with room resumes it. Recorded in the activity log.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
input | string | |
variables | object | |
reconciled | object | |
reason | string |
Responses
| Status | Type | Description |
|---|---|---|
| 202 | application/json | Accepted |
| 404 | Not Found | |
| 409 | Conflict |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/runs/$ID/retry" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "string",
"variables": {},
"reconciled": {},
"reason": "string"
}'Lists the agents this server defines, for use as the chat endpoints' agent field.#
/lmkit/v1/agentsEach entry names one reusable bundle an exchange can adopt: its description, the skill it pins, the server-executed tools it brings (names and count), whether it remembers across conversations, the model it answers with (empty follows the request or the server default), its thinking mode (empty follows the model's own default), and the fixed greeting a fresh conversation opens with. Adoption semantics are the chat endpoints': the bundle fills in wherever the request stays silent, and explicit request fields win.
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 401 | Unauthorized |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/agents" \
-H "Authorization: Bearer $LMKIT_API_KEY"Delivers an event to a trigger: a signed body that starts the trigger's agent or workflow run.#
/lmkit/v1/triggers/{id}Sign every delivery: X-LMKit-Timestamp is the time in Unix seconds, X-LMKit-Signature is sha256= and the hex HMAC-SHA256 of "." under the trigger's secret. A delivery more than five minutes from the server's clock is refused. The body is mapped into the run's input by the trigger's template. The answer is 202 with run_id at once; follow the run with GET runs/ under the trigger's key. A delivery already taken (same Idempotency-Key, or the same signed request sent again) answers 200 with its run and duplicate: true, and starts nothing.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 401 | Unauthorized | |
| 403 | Forbidden | |
| 404 | Not Found | |
| 409 | Conflict | |
| 413 | Payload Too Large | |
| 429 | Too Many Requests |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/triggers/$ID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Delivers an event to the caller's workflow runs waiting for it with this correlation key.#
/lmkit/v1/events/{name}A run whose wait_for_event step waits for this event name and correlation key, owned by the caller, takes the payload as that step's output and resumes on the first node with room. Each run takes an event once: a repeated delivery finds nothing waiting (resumed is then empty). Runs of other owners are never reached. A signed trigger whose target is event delivers the same way without an API key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
Request body
text/json ·
| Property | Type | Description |
|---|---|---|
correlation | string | |
payload | object |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 400 | Bad Request |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/events/$NAME" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"correlation": "string",
"payload": {}
}'Lists the workflows this server publishes, for use with workflows/{name}/runs.#
/lmkit/v1/workflowsEach entry names a published workflow: its description, the revision new runs start on, how many steps it has and the agents its steps run.
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 401 | Unauthorized |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/workflows" \
-H "Authorization: Bearer $LMKIT_API_KEY"Reads a published workflow: the JSON definition its runs start on.#
/lmkit/v1/workflows/{name}Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 401 | Unauthorized | |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/workflows/$NAME" \
-H "Authorization: Bearer $LMKIT_API_KEY"