Skip to content

POST /v1/chat/resume

Purpose

This endpoint resumes an execution after a tool approval request.

Request

http
POST /v1/chat/resume
Authorization: Bearer km_your_token_here
Content-Type: application/json

Minimal example

json
{
  "model": "group:123e4567-e89b-12d3-a456-426614174000",
  "approval_id": "86dd028d-6f5c-4f13-83db-d4fe9bc5b865",
  "approved_tool_execution_ids": [
    "1fb2fd25-8f78-412a-a0b8-7976e3700fc4"
  ],
  "messages": [
    {
      "role": "user",
      "content": "Continue with the action."
    }
  ]
}

Additional fields

In addition to the fields supported by POST /v1/chat/completions, this endpoint accepts:

FieldTypeRequiredNotes
approval_idstringyesUUID returned during approval
approved_tool_execution_idsarray<string>noUUIDs of approved tools
denied_toolsarray<object>nodenied tools with an optional reason

Deny a tool

Example with a denial:

json
{
  "model": "group:123e4567-e89b-12d3-a456-426614174000",
  "approval_id": "86dd028d-6f5c-4f13-83db-d4fe9bc5b865",
  "denied_tools": [
    {
      "tool_execution_id": "1fb2fd25-8f78-412a-a0b8-7976e3700fc4",
      "reason": "The action was not approved."
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "Do not execute that action."
    }
  ]
}

Response

The response follows the same general rules as POST /v1/chat/completions:

  • standard JSON when stream is absent or false
  • SSE when stream is true
  • another tool_calls step can appear if a new approval round is required

Important points

  • keep approval_id available until the full flow is finished
  • send only the tool_execution_id values that belong to the approval request being resumed
  • keep approval and denial handling explicit on the client side