# Get started with Zero Proof Labs from a terminal

For coding agents setting up an account and API key on someone's behalf.
Two commands. A new account needs no browser.

## New account

```bash
pip install zeroproof
zeroproof signup --email you@example.com
```

Creates the account and saves an API key to `~/.zeroproof/credentials.json`
(`$ZEROPROOF_HOME` overrides the directory). Every SDK call reads the key
from there. The person opens the dashboard later by signing in at
https://www.zeroproofai.com/platform with an email code to that address.
No password is ever set.

If it answers "already has an account", use login below.

## Existing account

```bash
zeroproof login
```

Prints a link and a short code. Show the link to the person; they sign in
and press Approve. The key is saved to the same file. If the command is
stopped before approval, run it again: it resumes the same code.
`zeroproof logout` deletes the file. `zeroproof status` shows which key
the SDK will use.

## Rules for agents

- Ask the person for the email address. Do not invent one.
- Never paste the key into the conversation. It lives in the file.
- `ZEROPROOF_API_KEY` in the environment overrides the file.
- One account per email. Five active keys per account. Five sign-ups per
  network address per day. Free daily allowance: 500k input and 1M
  output tokens, shared by all keys on the account.

## First call

```python
import zeroproof.simulations as zps

zps.datasets()                      # reads the saved key
data = zps.simulate(spec="specs/github", budget=20)
data.push("github-first-run")       # stored on the account
```

Every hosted endpoint takes the same key as the `X-Api-Key` header:
https://zeroproofai.com/api-key-skill.md. Trace ingest over
OpenTelemetry: https://zeroproofai.com/traces-skill.md.

## Without Python

No authentication on any of these.

```
POST https://api.zeroproofai.com/signup
{"email": "you@example.com", "name": "my-agent"}
-> 201 {"api_key": "zp_...", "user_id": "...", "email": "...", "name": "..."}
-> 409 {"error": "account_exists"}
-> 400 {"error": "invalid_email"}
-> 429 {"error": "too_many_signups"}

POST https://api.zeroproofai.com/device/code
{"name": "my-agent"}
-> 200 {"device_code": "...", "user_code": "ABCD-EFGH",
        "verification_uri_complete": "https://www.zeroproofai.com/device?code=ABCD-EFGH",
        "interval": 5, "expires_in": 900}

POST https://api.zeroproofai.com/device/token
{"device_code": "...", "user_code": "ABCD-EFGH"}
-> 400 {"error": "authorization_pending"}   poll every `interval` seconds
-> 200 {"api_key": "zp_...", "name": "...", "user_id": "..."}   returned once
-> 400 {"error": "expired_token"}           start over
```
