Sulat.com / Writing on AIThursday, December 3, 2026
Enter →
Agent Engineering/3 December 2026

Amp can now start agent threads over HTTP

Amp's new Threads HTTP API starts an orb thread from a plain POST and lets you read the reply. I ran four made-up alerts through the same kind of thread, and the agents fixed every one.

Amp wordmark in 3D with glowing check-marked orbs pouring from a terminal window, for the Amp Threads HTTP API
Illustration: Sulat, featuring the Amp logo

At a glance

  • Amp's Threads HTTP API creates an orb thread with one POST, lets you poll its state and read the reply, and accepts follow-up messages.
  • The agent runs as the token's owner, using their access, credentials and Amp credits, and machine-to-machine apps can't create threads.
  • The create call requires a project, and each user can start a burst of 20 metered orbs before Amp slows to one new orb every five minutes.
  • Four invented alerts run through Amp orb threads took between 2 minutes 40 seconds and 5 minutes 46 seconds to reach idle, and each agent reproduced and fixed its fault.
  • Cursor, GitHub Copilot and Jules each have an agent API too, and each is labelled beta, preview or alpha.

Amp has added an HTTP API for its orb threads. One POST creates a thread in a project and sends it the first message, a GET reads what the agent said, and a second POST sends a follow-up. Beyang, who works on Amp, says it’s one of the most common requests the team had.

Beyang’s announcement on X.

I don’t have an Amp access token, so I didn’t call the new endpoints with credentials. I ran the same kind of work through Puck, Amp’s assistant, which starts orb threads from a conversation, and I read the API reference and the OpenAPI file for how the HTTP side wraps it. Four made-up alerts went through, and I timed every thread.

What the API does

The whole loop is three endpoints. POST /api/v2/threads takes a project, a message and optionally a title, labels and an agent mode. It answers once the thread is accepted, and the agent keeps working after the response. GET /api/v2/threads/{id}/metadata reports the agent’s state, and Amp’s docs say to poll it until the state is idle. GET /api/v2/threads/{id}/messages returns the conversation, oldest first. A second POST to /messages adds a follow-up, and "steer": true delivers it into the running turn instead of queueing it behind the turn.

This is Amp’s own create example from the announcement.

Code
curl https://ampcode.com/api/v2/threads \
  -H "Authorization: Bearer $AMP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "project": "my-workspace/my-project", "title": "Fix CI on main", "labels": ["ci-failure"], "message": "Fix this CI failure: https://github.com/org/repo/actions/runs/1" }'
Amp Threads API flow: POST threads, poll metadata until idle, read messages and post a follow-up
Create, poll, read: the whole loop is three endpoints. Illustration: Sulat

Labels are lowercase, alphanumeric with hyphens, at most 20 a thread, so a bot can tag every thread it starts by alert type. The create call returns a 429 when one token owner starts more than 100 threads in a minute, and a 402 when the owner is out of credits. The limit that matters more sits in Amp’s orb docs: each user can start a burst of 20 metered orbs, and after that Amp starts one new orb every five minutes. Later starts wait instead of failing.

Whose token it is

You make a personal access token in Amp’s settings with three scopes: amp.api:threads:write, amp.api:threads.meta:read and amp.api:threads.contents:read. The thread belongs to the token’s owner, and the agent runs as them. The reference says it uses the owner’s access, credentials and Amp credits and isn’t limited to the token’s other scopes. For team automation Amp recommends a service account, with its token made in workspace settings and the account connected to GitHub or another code host so it can clone repositories.

Amp API token types: personal and service tokens can create threads, machine-to-machine apps cannot
Machine-to-machine apps can’t create threads, and the agent runs as the token owner. Illustration: Sulat

Machine-to-machine applications, the other kind of credential in Amp’s external API, can read and delete threads but can’t create them or post messages. Only the token owner’s own orb threads accept follow-ups.

The create call lists project as required. The threads I started through Puck had no project at all, and Amp’s apps offer a No Project option, but the API has no such option in its create body. A bot that wants a scratch sandbox needs a project to point at.

What I ran

Puck is available as an MCP server, so I could drive it from this session. I gave it each prompt below as the first message of a new orb thread, labelled alert-triage, with no project and nothing else added. That’s the same shape as the message field in a POST. I told Puck to keep every thread away from real projects, repositories and connected services, and the alerts are ones I invented, so each agent had to build the codebase it was fixing.

The first alert is a checkout service throwing a TypeError after a release. This is the message, verbatim.

Code
An alert fired. Reproduce it in this orb, fix it, add a regression test, run the tests, then reply with the cause, the diff and the test output.

Alert: {"service":"checkout","error":"TypeError: Cannot read properties of undefined (reading 'currency')","count_1h":412,"release":"v2026.12.02-3","stack":["src/cart/total.ts:48 applyDiscount","src/cart/total.ts:22 cartTotal","src/api/checkout.ts:91 POST /checkout"]}
There is no repository. Build a minimal TypeScript or JavaScript reproduction of these three files yourself.

The thread went from created to idle in 2 minutes 40 seconds. The agent wrote a small TypeScript service with line numbers matching the stack, reproduced the 500 on percent discount codes and left the no-code and fixed-amount checkouts working. The cause was the release’s new currency check, which read discount.amount.currency for every discount. Percent discounts have no amount, and an as any cast had hidden that from strict tsc, which passed on the broken code. The fix moved the check inside the fixed-discount branch.

Code
   if (discount.kind === "fixed") {
+    if (discount.amount.currency !== subtotal.currency) {
+      throw new Error(`Discount ${discount.code} is not valid for ${subtotal.currency}`);
+    }
     return clampToZero({ amount: subtotal.amount - discount.amount.amount, currency: subtotal.currency });
   }

Two of its four regression tests failed on the broken code with the alert’s exact error and all four passed after the fix. It also noted that a quick fix with discount.amount?.currency would still fail the percent tests, because the cart would then answer 422 instead of crashing. Its closing note said the work was verified in the reproduction only, since there was no real checkout service.

The follow-up

The API’s third call is a follow-up message. About nine minutes after that thread went idle, I had Puck send this, verbatim.

Code
Add a regression test for an empty cart and one for a negative quantity, then run the tests again and show me only the final test summary.

The thread finished in 34 seconds with six tests passing. It had sat idle for longer than the five-minute pause in Amp’s docs, and the reply still came back in about half a minute.

Three alerts at once

A bot that watches a tracker will start several threads together, so I had Puck start three at once. They were created within five seconds of each other, and each message was this, verbatim.

Code
1: An alert fired: cron job nightly-export exited 137 (killed) after 41 minutes, memory limit 512MB, the job streams a 2GB CSV into a Python list before writing. Build a small Python reproduction in this orb, fix it so memory stays flat, prove it by measuring peak memory before and after, and reply with the cause, the diff and the two numbers.

2: An alert fired: the endpoint GET /orders?customer=123 takes 4.8 seconds at p95. It runs one query per order line item. Build a small reproduction with SQLite in this orb, fix the N+1, prove it by timing before and after, and reply with the cause, the diff and the two timings.

3: An alert fired: the test "retries after timeout" fails about one run in five on CI. Build a small reproduction in this orb in any language, find the cause, fix it so it passes 200 runs in a row, and reply with the cause, the diff and the pass count.
AlertTime to idleBeforeAfter
Nightly job killed5 min 46 s1,189 MB peak on a 200 MB CSV; out of memory at a 512 MB cap on 2 GB11 MB peak on the 200 MB file; 10 MB and a clean finish on 2 GB under the cap
Slow orders query2 min 55 s10,501 queries a request; p95 53.7 ms in-process1 query; p95 23.2 ms in-process
Flaky retry test5 min 45 s44 failures in 200 runs200 passes in 200 runs
Created to idle, and what each agent measured in its own reproduction.

The nightly job’s cause was a list comprehension that held every parsed row in memory, about six times the file size. The fix wrote each row as it was read, and the agent checked that the output file was byte-identical to the old one. The 2 GB run took 105 seconds under the 512 MB cap.

The slow-query agent found two levels of per-row queries, one per order and one per line item, which is where 10,501 round trips came from. It replaced them with a single join and checked both versions returned the same result hash. SQLite runs inside the process, so the real gain only shows with network latency. The agent added a modelled 0.4 ms per query, which gave 5,365.6 ms before and 24.0 ms after, and said that the 0.4 ms is its assumption and not a measurement.

The flaky one was a bad test, and the retry code was fine. The fake upstream timed out twice, and the retry backoff added random jitter, so a run took between 350 and 500 ms against a hard 455 ms limit. The agent confirmed it by pinning the random value, which passed 20 of 20 at the low end and failed 20 of 20 at the high end. It fixed the test with fake timers and left the retry code alone.

Amp’s metadata lists the agent mode on all four threads as external-agent:claude-code. I didn’t pick it, and the create call has an agentMode field if you want to choose. The summaries each agent posted back to the conversation that started it, and the flaky-test agent’s check with that conversation about whether its alert was real, came through Puck. I can’t say the HTTP API does the same.

What it costs

Orbs bill by the minute while they run, and a paused orb costs nothing. Amp pauses an orb at least five minutes after the agent finishes, so every thread carries that tail. These are Amp’s standard prices.

SizeCPUsMemoryPer hour
a1.tiny12 GBUS$0.08
a1.small24 GBUS$0.17
a1.medium48 GBUS$0.33
a1.large816 GBUS$0.66
Source: Amp’s orb sizes and costs page.

The project default is a1.medium, and no-project threads take their size from personal settings, which I didn’t read. At the medium rate, a six-minute run plus the five-minute tail is about US$0.06. Subscribers draw on an allowance of orb minutes instead, and I covered one such plan in my piece on Megawatt 50. The agent’s model usage comes out of the token owner’s Amp credits as well, so a 402 means those ran out.

How it compares

Other coding agents already had APIs. They differ on token type and how settled the API is.

Comparison of Amp, Cursor, GitHub Copilot and Jules agent APIs by token type and maturity
Four vendors, four ways in. Cursor’s, GitHub’s and Jules’s APIs are each labelled beta, preview or alpha. Illustration: Sulat
  • Cursor’s Cloud Agents API is in public beta. It takes a user or service-account API key as Basic or Bearer auth, creates a durable agent with an initial run, and can target Cursor’s VMs or your own workers. Its docs say webhooks are coming to the v1 API, and the older v0 API still has them.
  • GitHub’s Copilot cloud agent has a tasks API in public preview. It accepts only user-to-server tokens, so a GitHub App installation token won’t work, and the body can pick a model and ask for a pull request.
  • Google’s Jules API is v1alpha, authenticated with an API key header. A session takes a source repository (optional for repoless sessions), an optional plan-approval gate and an option to open a pull request automatically.

Amp’s create body has no pull request switch and no model field. It has a project, a message, an optional agent mode, a title and labels, and the agent decides what to ship from the project’s setup. Amp already had the opposite direction: a plugin can register a public webhook that wakes an orb, and a thread can carry its own schedule. The HTTP API is how your systems start the work instead.

Where to be careful

The agent acts with the token owner’s access, so the text you put in message is an instruction to something holding those credentials. Amp’s own webhook docs tell plugin authors never to use webhook text as agent instructions without checking it. An error message copied from a tracker into a thread prompt is the same risk, because anyone who can make your service log a string can write into that prompt. A service account with narrow project access, and threads that open a pull request for review rather than deploy, are what I’d start with. That’s my reading of the risk and not something Amp states.

Amp’s OpenAPI file also lists experimental inference endpoints for models, embeddings, decisions and transcriptions. Those need a Sign in with Amp OAuth token and access from the Amp team, so they’re closed to everyone else for now.

What I didn’t run: any call with a token, a service account, the 429 and 402 paths, the agent mode field and the steer flag. A request to the create endpoint without a token returned {"status":401,"message":"Unauthorized"}.

What I’d do

I’d use it for the first pass on alerts and CI failures: reproduce the problem, propose a fix, and leave the review to a person. Four invented alerts is a small sample, and every agent here built its own codebase, which is easier than working inside a real repository. Even so, each one reproduced the fault, showed before and after numbers and said plainly that the result hadn’t been checked against the real service. The five-minute orb pacing after the first 20 is the number to plan around if you expect an alert storm.


Sources