Skip to main content
POST
Stop or complete a WorkItem

Headers

kimi-api-version
enum<string>

API version for this request, in YYYY-MM-DD form. Send 2026-09-01-beta for the version documented here. Required outside /v1/files*: a missing header there is rejected with 400 invalid_request_error; on /v1/files* its absence selects the compatibility behavior. An unknown value is rejected with 400 invalid_request_error on every endpoint. API versions served by the platform. New dated versions are added as they ship; a version is removed after its announced Sunset date.

Available options:
2026-09-01-beta

Path Parameters

environment_id
string
required

Environment the item belongs to.

id
string
required

WorkItem ID.

Body

application/json

Worker ID and fencing token for the current lease. Set final_status to completed when work is done. Omit it to request a graceful stop.

Request body of POST /v1/environments/{environment_id}/work/{id}/stop.

worker_id
string
required

Worker holding the lease.

Minimum string length: 1
Example:

"worker-1"

generation
integer<int64>
required

Fencing token the delivery returned.

Required range: x >= 1
Example:

1

final_status
enum<string>

Omit to request graceful stop. Send completed after tools and result writes finish, to confirm stop or release an idle lease.

Available options:
completed
Example:

"completed"

Response

The stop was requested or worker completion was confirmed.