Start a run and get its answer
A chat run asks CloudThinker a question with the token owner’s rights and spends credits. The token needschat:runs:write. The POST returns 201 at once, usually with status: pending; poll the run until it reaches a final status.
This script stops on the first HTTP error. In production, wrap each call in the retry loop. A workspace runs at most 20 agent runs at once, pending or running; the next
POST gets 429 rate_limited. A prompt that contains credentials is refused with 422.
To continue the conversation, send its conversation_id in the next POST. See Ask CloudThinker for every field.
What limits an API run
Which approval mode applies
These runs are chat runs, so they use the Chat run type. The mode comes from the first of these that is set:- The mode picked for that conversation
- The Chat run type override, in When no Rule matches on Settings → Workspace → Autonomy → Rules
- The workspace mode
When a run pauses
A run waiting for a person has statusrequired_approval. Its url opens the conversation in the browser, where an approver decides. cloudthinker chat exits with code 5.
A token with approvals:requests:read can list the pending requests you can answer. To answer one from a script, call POST /v1/workspaces/{workspace_id}/approvals/requests/{request_id}/decision with a personal token that has approvals:requests:write, or with your own sign-in. The body is {"decision": "approve"}, or {"decision": "deny", "reason": "..."}, because a deny needs a reason. You answer as yourself, with your own rights.
- Service account and MCP tokens are refused, so an unattended pipeline can’t approve its own writes.
- You can’t answer a request you started.
- Only pending requests can be answered. After a Chat request is answered, the conversation resumes, so its status can still read
pendingfor a moment.
required_approval and report the url instead; the run still continues after a person decides.
Related
Approval mode
Set the mode for the workspace, a run type or one chat.
Rules
Allow, ask first or deny an exact write.