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, under Approvals → Approval mode → Run types
- 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 pending requests from the API, but no token can answer them: approving or rejecting always happens in the app, by a person. This keeps a leaked token from approving its own writes.
The polling example above keeps waiting through a pause and prints the approval link once. A script that can’t wait, such as a CI job, can stop at 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.