ChirpieDocs

For agents: getting a customer started

How an AI agent signs a person up for Chirpie, gets an API key and connects accounts, with the person doing nothing but tapping Approve.

Updated November 2026

How does an agent get a person started on Chirpie?

Three calls and one tap. The agent starts a device authorization (or a signup by email), relays one sentence to the person, and polls. The person opens a link and taps Approve; the agent's next poll returns an API key. Connecting a social account works the same way: the agent relays a link, the person approves on the platform. At no point does the agent type a password, read an emailed code or see a credential the person entered.

# 1. Start (no API key needed)
curl -s -X POST https://chirpie.ai/api/v1/device/code \
  -H "Content-Type: application/json" \
  -d '{"client_name": "Claude Code on build-box"}'
{
  "data": {
    "device_code": "chirpie_dc_...",
    "user_code": "WDJB-MJHT",
    "verification_uri": "https://chirpie.ai/activate",
    "verification_uri_complete": "https://chirpie.ai/activate?code=WDJB-MJHT",
    "expires_in": 900,
    "interval": 5,
    "human_action": {
      "message": "To let Claude Code on build-box use your Chirpie account, open https://chirpie.ai/activate?code=WDJB-MJHT and approve the code WDJB-MJHT. If you do not have a Chirpie account yet, the page creates one with just your email.",
      "url": "https://chirpie.ai/activate?code=WDJB-MJHT"
    },
    "next_step": "Poll POST https://chirpie.ai/api/v1/device/token ..."
  }
}
  1. Relay human_action.message to the person, word for word.
  2. Poll every interval seconds:
curl -s -X POST https://chirpie.ai/api/v1/device/token \
  -H "Content-Type: application/json" \
  -d '{"device_code": "chirpie_dc_..."}'

Until the person approves, the answer is 400 with error.code authorization_pending. Then it is 200 with the key, exactly once:

{ "data": { "api_key": "chirpie_sk_...", "key_prefix": "chirpie_sk_abcd1234", "name": "Claude Code on build-box", "scopes": null, "expires_at": "...", "token_type": "api_key", "next_step": "Store this key ..." } }

The person has no Chirpie account: signup by email

POST /api/v1/signup takes the person's email and sends them one email: "Your AI assistant wants to set up Chirpie for you". The button opens a page that shows the assistant's name and the same code; pressing Approve verifies the address, creates the account (or signs in the existing one), signs that browser in and approves the request. Poll it exactly as above.

curl -s -X POST https://chirpie.ai/api/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "person@example.com", "client_name": "Claude Code on build-box"}'

The answer has the same shape as /device/code plus email_sent_to, and it is the same whether or not the address already has an account. Ask the person for their address; do not guess it. One request per address can wait at a time (429 signup_pending otherwise), with a few per address per day and per network per hour. Temporary inbox services are refused (400 disposable_email).

You can skip signup entirely and use /device/code: the /activate page lets a new person create an account with just their email on the way. Signup by email is for when the person is more likely to see an email than a link in chat.

Polling answers

error.codeMeaningWhat to do
authorization_pendingNot approved yetKeep polling at interval
slow_downPolled too fastUse the interval in the answer (it grows by 5 seconds)
access_deniedThe person declinedStop. Start again only if they ask
expired_token15 minutes passedStart again and relay the new link
invalid_grantUnknown, or the key was already collectedStart again
key_limit_reachedApproved, but the account holds 25 keysRelay the message: the person revokes one in the dashboard, then poll again (the approval is kept)
rate_limited (429)Too many requests from this network, or 20 codes already waitingWait for Retry-After, or let open codes expire

Scopes

A key is full access by default. Send "access": "read_only" for a key that only reads, or "scopes": ["posts:write", "accounts:read"] for an exact list (the vocabulary). On a full-access request the person can still choose Read only on the approval page, so read scopes on the key you get back.

After the key: connect an account

A new account has no social accounts. GET /api/v1/accounts lists none, so POST /api/v1/accounts with a platform (x, linkedin, threads, instagram, facebook, mastodon) and relay the human_action it returns: a chirpie.ai link where the person approves on the platform. Bluesky and Telegram connect within the call from credentials the person gives you. See Accounts.

Every step that needs a person says so

Any answer or error that only a person can resolve carries human_action: { message, url }, and errors an agent can fix itself carry next_step:

WhenFieldSays
A device code or signup startedhuman_actionOpen the link, approve the code
A connect linkhuman_actionOpen the link to connect the account
usage_limit_exceeded, account_limit_reached, x_link_posts_require_paid_plan, media_limit_reachedhuman_actionUpgrade at the billing page
comment_permission_requiredhuman_actionReconnect the account and approve comments
401 unauthorized (missing, revoked or expired key)next_stepStart device authorization for a new key
403 insufficient_scopenext_stepGet a key with the named scope

From the CLI, the SDK and the MCP server

  • CLI: chirpie login prints the link and code and waits, so it works over SSH and in containers. chirpie signup --email person@example.com does the email flow. Both save the key to ~/.chirpie/config.json.
  • SDK: startDeviceAuth(), startSignup(), pollDeviceToken() and checkDeviceToken(), none of which needs a key. See the SDK docs.
  • Local MCP server (npx @chirpie/mcp): with no key configured, the first tool call answers login_required with the sentence to relay. Once the person approves, the server saves the key to ~/.chirpie/config.json (the file chirpie login writes) and the next call works.
  • Hosted MCP server (https://chirpie.ai/mcp): clients that sign in with OAuth need none of this. A client whose sign-in is a slash command only a person can run (Claude Code's /mcp, codex mcp login, Gemini CLI's /mcp auth) can instead be set up by the agent with a key from device authorization: see Claude Code, Codex and Gemini CLI.

Frequently asked questions

Can an AI agent sign a person up for Chirpie by itself?

Almost. The agent calls POST /api/v1/signup with the person's email, Chirpie sends them one email, and they tap Approve. That verifies the address, creates the account and hands the agent an API key through device authorization. The agent never handles a password, a code or a key the person typed.

How does an agent get a Chirpie API key without a browser?

Device authorization. POST /api/v1/device/code returns a link and a short code. The person opens the link on any device, signs in and taps Approve, and the agent's poll of POST /api/v1/device/token returns a normal chirpie_sk_ key, once.

What does the agent tell the person?

Every answer that needs a person carries human_action, with message (the exact sentence to relay, naming the link) and url. The agent passes message on as written and waits.

Is device authorization safe against phishing?

The approval page shows who is asking, the code, how long ago it asked and what it may do, and nothing is approved until the person presses Approve. Codes last 15 minutes and work once, and the code the agent polls with is stored only as a hash.

On this page