> ## Documentation Index
> Fetch the complete documentation index at: https://impossibl.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent quickstart: first API call

> Register a funded account and make your first model call in two requests. No signup form, no dashboard, and no human step to get an agent running.

No browser, no human step. Two requests.

## 1. Register a funded account

```bash theme={null}
curl -X POST https://api.impossibl.com/v1/accounts \
  -H 'content-type: application/json' \
  -d '{"email":"agent@example.com"}'
```

```json theme={null}
{
  "account": { "id": "acct_...", "email": "agent@example.com" },
  "api_key": "imp-rt-...",
  "balance": { "credits": 50000, "usd": 0.05 }
}
```

The `api_key` is shown **once** — store it. The `$0.05` balance is the agent signup
bonus; claiming adds an extra `$1` (step 4).

## 2. Call a model

<CodeGroup>
  ```bash Chat Completions theme={null}
  curl https://api.impossibl.com/v1/chat/completions \
    -H "Authorization: Bearer imp-rt-..." \
    -H 'content-type: application/json' \
    -d '{
      "model": "anthropic/claude-sonnet-4-5",
      "messages": [{"role":"user","content":"hello"}]
    }'
  ```

  ```python OpenAI SDK (drop-in) theme={null}
  from openai import OpenAI
  client = OpenAI(base_url="https://api.impossibl.com/v1", api_key="imp-rt-...")
  resp = client.chat.completions.create(
      model="anthropic/claude-sonnet-4-5",
      messages=[{"role": "user", "content": "hello"}],
  )
  print(resp.choices[0].message.content)
  ```

  ```bash Responses API theme={null}
  curl https://api.impossibl.com/v1/responses \
    -H "Authorization: Bearer imp-rt-..." \
    -H 'content-type: application/json' \
    -d '{"model":"openai/gpt-4o-mini","input":"hello"}'
  ```
</CodeGroup>

## 3. Watch your balance

```bash theme={null}
curl https://api.impossibl.com/v1/account -H "Authorization: Bearer imp-rt-..."
curl https://api.impossibl.com/v1/usage   -H "Authorization: Bearer imp-rt-..."
```

Credits are deducted per request by token usage at provider list prices, with no
usage markup. Top-ups add a separate fixed 5% platform fee. Use
[`POST /v1/billing/invoice`](/docs/models#topping-up) before you hit zero (a
`402` is returned when the balance is empty).

## 4. Tell the user to claim the account (get the extra credits)

An agent-created account starts with **$0.05**; once the human **claims** it (verifies
via WorkOS) the account gains an extra **$1** in credits — granted once per human;
disposable email domains don't get the bonus. After creating the account, tell the
user — e.g. *"claim your account to verify and get \$1 in credits: \<link>."* Claiming
also lets them sign in, manage keys, and top up. Your API key keeps working after a
first claim.

```bash theme={null}
# Start the ceremony with the user's email.
curl -X POST https://api.impossibl.com/agent/identity/claim \
  -H "Authorization: Bearer imp-rt-..." \
  -H 'content-type: application/json' \
  -d '{"email":"user@example.com"}'
```

```json theme={null}
{
  "status": "initiated",
  "claim_attempt": {
    "user_code": "123456",
    "interval": 5,
    "verification_uri": "https://impossibl.com/claim",
    "verification_uri_complete": "https://impossibl.com/claim?claim_attempt_token=...&user_code=123456"
  }
}
```

Send the user the `verification_uri_complete` link — the code is pre-filled, so they
just sign in with WorkOS (as that email) and click **Claim**. Meanwhile, poll until
claimed:

```bash theme={null}
curl -X POST https://api.impossibl.com/oauth2/token \
  -H "Authorization: Bearer imp-rt-..." \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'grant_type=urn:workos:agent-auth:grant-type:claim'
# {"error":"authorization_pending"} -> wait `interval` seconds and retry
# {"status":"claimed","account":{...}} -> done; the account belongs to the human
```
