Step 1: create the agent
202. You are the owner. With no visibility in the request, the agent is public if you are an Org admin or a Project admin, and private otherwise.
400or422 invalid_request:agent_configis missingroleorobjective, or one exceeds its length limit.409 agent_quota_exceeded: the organization holds 100 live agents. Delete an unused agent.
Step 2: wait until the agent is ready
200 with "status": "ready". Poll once per second until it flips from initializing to ready (usually a few seconds).
If it is not ready:
initializingfor more than a minute: keep polling. After 10 minutes it moves tofailed.failed: delete the agent and create a new one.404 agent_not_found: checkagent_idand your key.
Step 3: create a thread
201. The thread is ready immediately.
409 agent_not_ready: finish step 2 first.429 rate_limit_exceeded: more than 5 threads in 10 seconds. WaitRetry-Afterseconds.
Step 4: teach the agent
202. Nothing is learned yet; save observation_id.
400or422 invalid_request:contentis empty orspeakeris missing (required with an API key).402 payment_required: organization has zero credits.404 thread_not_found: checkagent_idandthread_id.
Step 5: wait until the facts are learned
200 with "status": "committed".
processing: poll again afterRetry-After(or 1 second).interrupted: a Priors restart paused it; keep polling as it resumes automatically.failed: readerrorandlearning, fix the input, and resend.
Step 6: ask a question
200. The finished answer is in answer.
…/respond instead of observe-and-respond.
If it fails:
429 rate_limit_exceeded: more than 20 answers in one minute or 2 concurrent answers. WaitRetry-Afterseconds.503 answer_model_unavailable: retry with the sameIdempotency-Key.
What this walkthrough showed
- Agent creation and
observeboth run asynchronously; poll untilreadyandcommitted. observe-and-respondreturns a finished answer (and learns the turn);respondanswers without learning.- Memory belongs to the agent: opening a second thread answers the same question identically.