AimableDocs
DocsAPI Reference
POST/v1/spaces/{space_id}/responses/{response_id}/cancel

Cancel Response Route

Cancel an in-flight response. * 202 — in-flight response, cancel acknowledged; state transitioning to ``cancelled`` (cooperative, bounded <5s). * 200 — response was already terminal; idempotent no-op, body returns current state unchanged. * 404 — unknown response id, or response belongs to a different space.

Path Parameters

NameTypeRequiredDescription
space_idstring (uuid)Required
response_idstringRequired

Headers

NameTypeRequiredDescription
X-API-KeystringOptional

Request

curl -X POST '/api-proxy/v1/spaces/{space_id}/responses/{response_id}/cancel' \
  -H 'Authorization: Bearer <YOUR_TOKEN>'

Response

200(generated)
{
  "data": {
    "id": "string",
    "object": "response",
    "status": "queued",
    "created_at": "2024-01-01T00:00:00Z",
    "finished_at": {},
    "expires_at": "2024-01-01T00:00:00Z",
    "space_id": "550e8400-e29b-41d4-a716-446655440000",
    "model": "string",
    "model_alias": "string",
    "previous_response_id": {},
    "output": [
      {}
    ],
    "usage": {
      "input_tokens": 0,
      "output_tokens": 0,
      "reasoning_tokens": 0,
      "cost_usd": "0.000000"
    },
    "aimable": {
      "langfuse_trace_id": {},
      "governance_applied": {},
      "iteration_count": 0,
      "failure_reason": {}
    }
  }
}

Error Responses