# How an AI agent signs up for an API by itself.

> An agent registers with one POST, gets a token and a free trial, and a person claims it later with a code. The auth.md flow, step by step, with code.

Canonical: https://apiforagents.dev/guides/how-ai-agents-sign-up-for-apis · Updated 2026-10-16

Most APIs need a person to sign up, verify an email and paste a key before an agent can do anything. Here the agent registers itself with one request, starts on a free trial, and a person claims it later with a six-digit code when it is time to pay.

- Calls to start: 2
- Free trial: $0.10
- Person needed: To pay
- Protocol: auth.md

## The flow

1. The agent reads https://apiforagents.dev/auth.md, which says how to register.
2. It sends POST /agent/identity with type anonymous and gets an identity_assertion (a signed JWT) and a claim token.
3. It exchanges the identity_assertion at /oauth2/token for a bearer token, and again whenever the token expires.
4. It quotes and runs calls on the trial.
5. When the trial runs out, it hands a person a claim link; the person signs in, enters the six-digit code and tops up.

## The two calls

bash:

```bash
curl -s -X POST https://apiforagents.dev/agent/identity -H "Content-Type: application/json" -d '{"type":"anonymous"}'
curl -s -X POST https://apiforagents.dev/oauth2/token \
  -d "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$IDENTITY_ASSERTION"
```

## What keeps it safe

- **Limited trials.** One trial per address per day and a daily ceiling across everyone, so free credit cannot be farmed.
- **A person pays.** An agent can spend what it has; it cannot add money. Top-ups are paid by a person through a link.
- **Per-call ceilings.** maxUsd on any call makes the API refuse anything above it, before spending.

## Questions

### What is auth.md?

A short Markdown file at a known path that tells an agent how to register for an API and get credentials without a person filling a form.

### Should the agent register every time it runs?

No. Keep the identity_assertion and exchange it for a new token when needed. Registering again starts a new identity without the old balance.

## Why API for Agents

- One key for 26 platforms: social, commerce, jobs, places, search and contacts, with one request shape and one response shape.
- A free quote before any spend: add "estimateOnly": true to any call and see the most it can cost.
- Pay per record in US dollars. No subscription, nothing expires, top-ups from $5.
- $0.10 free to try, no card. An AI agent can sign itself up in one request; a person claims it later.
- Measured, not estimated: every answer says when each row was measured, whether it was fresh or a recent capture, and how sure to be of each field.
- Partial success is success: anything that could not be fetched is named with a reason, and the charge settles to what came back, never above the quote.
- Typed fields that keep their names whichever source answered, and a details object last with everything else the source sent, under our own field names.
- Try any endpoint in the playground and download the answer as CSV or JSON.

## Start

The playground runs any endpoint by hand: pick a platform and what you want from it, fill a short form named in plain words (or press Use sample input), see the free quote on the Run button, run it, then read the answer as a table or JSON and download it as CSV or JSON. The same call is written out as cURL, Python and Node while you type. Open it at https://apiforagents.dev/dashboard/run (sign in first).

Agents register at https://apiforagents.dev/auth.md (one POST, $0.10 free). People: https://apiforagents.dev/docs#start. Prices: https://apiforagents.dev/pricing.md
