Complete a run segment
POST
/runtime/v1/runs/{runId}/complete
const url = 'https://mw.omazy.ai/api/v1/runtime/v1/runs/3fa85f64-5717-4562-b3fc-2c963f66afa6/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"state":"done","stop_reason":"example","outcome_md":"example","session_id":"example","usage":{"input_tokens":1,"output_tokens":1,"cached_input_tokens":1},"total_cost_usd":1,"num_turns":1,"error":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://mw.omazy.ai/api/v1/runtime/v1/runs/3fa85f64-5717-4562-b3fc-2c963f66afa6/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "state": "done", "stop_reason": "example", "outcome_md": "example", "session_id": "example", "usage": { "input_tokens": 1, "output_tokens": 1, "cached_input_tokens": 1 }, "total_cost_usd": 1, "num_turns": 1, "error": "example" }'Reports the segment’s result, revokes the run’s MCP key and releases the lease. state paused keeps a run waiting on a human.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”runId
required
string
Example
3fa85f64-5717-4562-b3fc-2c963f66afa6Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
state
required
string
stop_reason
Harness StopReason, e.g. outcome, max_iterations, max_budget, error_upstream.
string
outcome_md
string
session_id
string
usage
object
input_tokens
integer
output_tokens
integer
cached_input_tokens
integer
total_cost_usd
number
num_turns
integer
error
string
Responses
Section titled “Responses”No content
Bad request
Unauthorized
Forbidden
Not found
Runtime_lease_expired
Omazy CX documentation. One voice. Every channel. Always on.
Founded by Mosthofa Imran · imran@omazy.ai
© 2026 Omazy CX