Amp News 推出 Threads HTTP API
Threads HTTP API
Amp News 推出 Threads HTTP API,允许用户通过 HTTP API 创建 Amp orb 线程、读取智能体响应和发送后续消息,支持自动化系统将任务委托给 Amp。
You can now create Amp orb threads, read agent responses, and post follow-up messages through the HTTP API.
This makes it easy for any automated system to delegate work to Amp:
- Investigate alerts. An error tracker or paging webhook starts a thread for each critical alert.
- Fix CI failures. When CI fails on
main, a thread finds the cause and opens a fix PR. - Triage on a schedule. Every morning, a job sends the past day's top errors to Amp.
- Start threads from bots and internal tools. A Slack bot, a support workflow, or an issue-report queue starts a thread, then reads the result or sends a follow-up.
To try it, create a personal access token in Settings → Access Tokens with these scopes:
amp.api:threads:writeamp.api:threads.meta:readamp.api:threads.contents:read
If you're testing this in the terminal, set AMP_TOKEN to this value.
Then, start a new orb thread:
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"
}'
Read the agent's response:
curl "https://ampcode.com/api/v2/threads/$THREAD_ID/messages?limit=100" \
-H "Authorization: Bearer $AMP_TOKEN"
And send a follow-up message:
curl https://ampcode.com/api/v2/threads/$THREAD_ID/messages \
-H "Authorization: Bearer $AMP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Add a regression test for this failure."}'
For organization or team-level automations, we recommend using a service account. Create the service account's access token in Workspace Settings → Service Accounts. Remember to connect the service account to GitHub or your code host, so it can clone repositories.

See the Threads API docs for full details.
来源: Amp News · ampcode.com