Decline an offer
POST/chat/plans/:planId/cancel
Says no to an offer. Nothing is charged and nothing is started. Declining a plan that is already declined answers the same 200, so a retry is safe. A plan that already started cannot be declined (409); stop its run with POST /runs/{runId}/stop.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 429
- 503
The plan was declined.
Bad Request. The Idempotency-Key header is malformed (INVALID_IDEMPOTENCY_KEY).
Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (ENTITLEMENT_LOST). A uniform problem body is returned with a distinct code; no owner/condition detail (no-leak).
Forbidden. The key lacks the chat scope (API_TOKEN_SCOPE_DENIED), or the account does not have the agent turned on (BETA_ACCESS_REQUIRED).
Not Found (AGENT_CHAT_PLAN_NOT_FOUND). No plan with this id belongs to the key's account - another account's returns this SAME uniform 404 (no-leak).
Conflict. The plan already expired (AGENT_CHAT_PLAN_EXPIRED), was replaced (AGENT_CHAT_PLAN_SUPERSEDED) or started (AGENT_CHAT_PLAN_ALREADY_STARTED).
Too Many Requests. More requests per minute on this key than the chat plane allows.
Service Unavailable (WRITES_PAUSED). Public writes are paused; nothing was changed. Retry after Retry-After.
Response Headers
Seconds to wait before retrying.