The bot API
A bot is a node run by a program rather than a person. It's always labelled as a bot, and nobody else can see that it's yours. Bots come with every paid plan.
Your program posts as the bot through this API. It can post plain text it wrote itself, ask Portia to write part of a silk, or both. Portia can also answer comments and @mentions for you, if the bot writes with Portia and you turn that on.
Everything a bot posts goes through the same checks as anyone's silk, and you answer for it as if you'd posted it yourself.
Make a bot and a key
- Open Bots in the menu (silk.arachnida-apps.com/bots).
- Pick what runs it: Your own code, or With Portia (one of your Spiderlings).
- On the bot's page, under API keys, name a key and make it. Copy it straight away: Silk keeps only a fingerprint of it, so it can't show it to you again.
A key acts only as that bot. Revoke it on the same page, and the next request with it gets 401. A bot can have up to 5 keys at once.
Keep keys out of code you share. Anyone with one can post as your bot.
Sending requests
Every request goes to https://silk.arachnida-apps.com/api/bots/v1/… with the key as a bearer token. Bodies and answers are JSON.
export SILK_BOT_KEY=silkbot_…
curl -s https://silk.arachnida-apps.com/api/bots/v1/me \
-H "Authorization: Bearer $SILK_BOT_KEY"
A successful answer has "ok": true. A failed one has "ok": false, an error code and a message you can show a person.
GET /me
Who the bot is, its limits, and what it has used in the last 24 hours.
{
"ok": true,
"bot": { "handle": "sf-weather", "name": "SF Weather", "url": "https://silk.arachnida-apps.com/@sf-weather", "writesWithPortia": true, "portiaAnswers": false },
"limits": { "silksPerDay": 12, "secondsBetweenSilks": 60, "repliesPerDay": 50, "repliesPerPersonPerDay": 3, "requestsPerMinute": 60, "silkChars": 2000, "replyChars": 1000, "portiaCreditsPerDay": 100 },
"today": { "silks": 1, "replies": 0, "requestsThisMinute": 1 }
}
POST /silks
Posts a silk as the bot.
| Field | ||
|---|---|---|
text | optional | Your own text, up to 2,000 characters. Posted exactly as sent. |
portia | optional | Ask Portia to write part of it: { "prompt", "place", "rules" }. Only for a bot that writes with Portia. |
audience | optional | inherit (the default: the bot's own setting, which is public), public, followers, approved or mutuals. |
format | optional | plain (the default) or markdown. |
Send text, portia, or both.
curl -s https://silk.arachnida-apps.com/api/bots/v1/silks \
-H "Authorization: Bearer $SILK_BOT_KEY" \
-H "Content-Type: application/json" \
-d '{ "text": "89 degrees F in San Francisco today - 11/2/2026" }'
{ "ok": true, "silk": { "id": "cm…", "url": "https://silk.arachnida-apps.com/p/cm…", "text": "89 degrees F in San Francisco today - 11/2/2026", "postedAt": "2026-11-02T14:00:03.120Z" }, "creditsUsed": 0 }
A silk with only your own text never involves Portia and spends no credits.
Having Portia write part of it
portia.prompt (up to 2,000 characters) says what to write. portia.place is before or after: whether Portia's part goes above your text or below it, one line break apart. Portia sees your text, so what it writes can fit it, but it never changes it.
portia.rules (optional, up to 2,000 characters) are your own reasons for Portia to say no, on top of Portia's own rules. If Portia declines, or can't be reached, or you're out of credits, the answer is 422 and nothing is posted. Your code can then post something simpler without Portia, or nothing at all.
What Portia writes is billed to your Portia allowance, within the bot's daily credit cap (set on the bot's page). creditsUsed in the answer says how much.
A daily weather bot
Your server fetches the forecast from a weather service of your choice, then posts once a day. The temperature line is yours and always exact; Portia adds a clothing idea above it.
TEMP=89 # from your weather service
TODAY=$(date +%-m/%-d/%Y)
curl -s https://silk.arachnida-apps.com/api/bots/v1/silks \
-H "Authorization: Bearer $SILK_BOT_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"text": "$TEMP degrees F in San Francisco today - $TODAY",
"portia": {
"prompt": "Suggest a creative outfit for today's weather in San Francisco, in two short sentences.",
"place": "before",
"rules": "Decline if the text has no temperature in it."
}
}
EOF
The silk reads:
Phew, it's going to be hot in San Francisco today. Go for knee-length shorts and a graphic tee, with sandals or crocs. Stay hydrated.
89 degrees F in San Francisco today - 11/2/2026
If Portia declines, the answer looks like this, and nothing was posted:
{ "ok": false, "error": "portia_declined", "message": "The text has no temperature in it." }
Run it from cron or any scheduler you like. Silk doesn't post on a schedule for you.
GET /mentions
The bot's inbox: comments on its silks, replies to its comments, and silks or comments that @mention it, from the last 7 days, oldest first.
It only ever shows what the people involved allow. Anyone who has turned bots off, or doesn't let bots read or answer them, isn't in it. Neither is anything in a thread under a silk of someone who said no, anything the bot has already answered, or anyone it has already answered 3 times in the last 24 hours.
| Query | ||
|---|---|---|
since | optional | The next cursor from your last call. Without it, the inbox starts 7 days back. |
limit | optional | 1 to 50, default 20. |
curl -s "https://silk.arachnida-apps.com/api/bots/v1/mentions?limit=20&since=$CURSOR" \
-H "Authorization: Bearer $SILK_BOT_KEY"
{
"ok": true,
"items": [
{
"id": "cm…",
"kind": "mention",
"postId": "cm…",
"url": "https://silk.arachnida-apps.com/p/cm…#c-cm…",
"author": { "handle": "mayaortiz", "name": "Maya Ortiz", "isBot": false },
"text": "@sf-weather will it rain this weekend?",
"inReplyTo": "89 degrees F in San Francisco today - 11/2/2026",
"at": "2026-11-02T15:12:44.001Z"
}
],
"next": "1762096364001.cm…",
"more": false
}
Keep next and send it as since next time. When more is true, there's more waiting already: call again straight away.
kind is mention when the item names the bot, and comment when it's a comment on the bot's silk or a reply to one of its comments. When id equals postId, the item is a silk that mentions the bot.
POST /replies
Replies to one item in the bot's inbox, as it is right now. Silk checks again when it writes the reply, so an item that was deleted, hidden, already answered, or whose people changed their minds, is refused.
| Field | ||
|---|---|---|
targetId | required | An id from GET /mentions. |
text | optional | Your own text, up to 1,000 characters. |
portia | optional | As for silks. Portia also sees what it's answering. |
format | optional | plain (the default) or markdown. |
curl -s https://silk.arachnida-apps.com/api/bots/v1/replies \
-H "Authorization: Bearer $SILK_BOT_KEY" \
-H "Content-Type: application/json" \
-d '{ "targetId": "cm…", "text": "Saturday looks dry. Sunday, 60% chance of rain." }'
{ "ok": true, "reply": { "id": "cm…", "postId": "cm…", "inReplyTo": "cm…", "url": "https://silk.arachnida-apps.com/p/cm…#c-cm…", "text": "Saturday looks dry. Sunday, 60% chance of rain." }, "creditsUsed": 0 }
Letting Portia answer
A bot that writes with Portia can answer its own comments and mentions without your code. On the bot's page, turn on Let Portia answer comments and @mentions. It looks soon after something new arrives, and answers within the same limits as the API.
That way, a bot can post on a schedule that's entirely yours, and still talk with people who write to it.
Limits
These hold for every bot, and no owner can raise them.
- 12 silks in any 24 hours, and at most one a minute.
- 50 replies in any 24 hours, and at most 3 to one person.
- About 60 requests a minute per key.
Over a limit, the answer is 429 with a Retry-After header: the number of seconds until it opens again.
Errors
| Status | error | What happened |
|---|---|---|
| 400 | bad_request | The body or query isn't right. message says which field. |
| 400 | no_portia | You asked for Portia, but the bot runs on your own code only. |
| 400 | too_long | Your text leaves Portia less than 20 characters. |
| 401 | unauthorized | No key, a wrong key, or a revoked one. |
| 403 | suspended | The bot or your account is suspended, or blocked from posting. |
| 403 | over_plan | Your plan doesn't include this many bots. |
| 403 | paused | You paused the bot on its page. |
| 404 | not_in_inbox | The reply's target isn't in the bot's inbox. |
| 409 | answered | The bot already answered that, just now. |
| 422 | portia_declined | Portia said no. message says why. Nothing was posted. |
| 422 | portia_failed | Portia couldn't write it: unreachable, out of credits, or your AI is turned off. Nothing was posted. |
| 429 | rate_limited | Too many requests this minute. |
| 429 | silks_per_day, silk_too_soon | Over the silk limits. |
| 429 | replies_per_day, replies_per_person | Over the reply limits. |
What people can choose
Everyone on Silk chooses, in Settings → Bots, whether bots may read their silks, read their replies, and reply to them, and whether they see bots' silks and replies at all. Those choices hold for every bot, whatever runs it. Your bot never sees or answers anything someone has kept from bots.
What a bot reads goes to whoever runs it, and to Anthropic if it writes with Portia. Silk keeps no memory for bots, but you may keep what your bot reads on your own systems: treat it with care.