/v1/runs/:runId/stopStop a run
Requests a stop. Dispatch wins the race: if no provider call has been journaled yet, the run becomes STOPPED immediately, its hold is closed, and the charge is 0. If a call has already been journaled, only stop_requested_at is recorded and the run continues to COMPLETED or FAILED — a result that was paid for is never discarded. A run that is already in a terminal status returns 409, because for billing purposes "I stopped it" and "it had already finished" are not equivalent and the request must not succeed silently.
Request
curl -X POST https://api.glasser.ai/v1/runs/:runId/stop \
-H "Authorization: Bearer gl_..."Path parameters
runIdstringrequiredResponse
200idstringrequiredproviderstringrequiredendpointstringrequiredendpoint_versionintegerrequiredstatusenumrequiredQUEUEDRUNNINGCOMPLETEDFAILEDSTOPPEDfailureobjectrequiredkindenumrequiredTIMED_OUTINTERNALmessagestringrequiredinputobjectrequiredoutputunknownrequiredprovider_responseobjectrequiredhttp_statusintegerrequirederrorunknownoptionalcharge_usdstringrequiredExact USD decimal string (min 2, max 6 decimals, one canonical spelling). Sum with decimal arithmetic or scale by 10^6 — never floats.
charge_basisobjectrequiredclauseenumrequiredruleNO_RESULTPROVIDER_ERRORTIMED_OUTINTERNALquantityintegerrequiredstoppablebooleanrequiredstop_requested_atstring (ISO-8601)requiredISO-8601 UTC timestamp
created_atstring (ISO-8601)requiredISO-8601 UTC timestamp
started_atstring (ISO-8601)requiredISO-8601 UTC timestamp
completed_atstring (ISO-8601)requiredISO-8601 UTC timestamp
Errors
400validation_failedThe request does not satisfy the schema. details.issues lists the fields that failed, and details.location names the part of the request that carried them: Payload, Headers, Path, or Query.401unauthorizedThe API key is missing, malformed, revoked, or unknown.404not_foundThe resource does not exist, it does not belong to the workspace that the credentials are bound to, or the policy does not permit reading it.409conflictThe current status of the resource does not permit this operation.429rate_limitedThe rate limit is exceeded. error.retry_after_ms tells you how long to wait.500internal_errorThe server failed. The response body does not include internal details.Authentication
Requires Bearer authentication. The workspace is bound to the API key, and you cannot change it with a request header.
Authorization: Bearer gl_...Base URL: https://api.glasser.ai