# auth.md

pcb.dog public API: anonymous access. Credentials exist but are optional today.

## Agent audience

AI agents and scripts fetching PCB quotes (`GET /api/quote`), running Gerber pre-checks (`POST /api/analyze`), placing orders (`POST /api/orders`, then `POST /api/orders/{order_id}/confirm`) and saving quotes with an e-mail (`POST /api/leads`).

## Access

- All documented endpoints accept unauthenticated requests. No account is needed.
- Send a descriptive User-Agent. Abusive traffic is rate limited at the edge.
- `POST /api/orders` stores the shipping address and e-mail with the order; `POST /api/leads` stores the e-mail with the quote. Both are used only for that order or quote. Privacy notice: https://pcb.dog/en/privacy

## OAuth metadata

- Protected Resource Metadata (RFC 9728): https://pcb.dog/.well-known/oauth-protected-resource
- Authorization Server Metadata (RFC 8414): https://pcb.dog/.well-known/oauth-authorization-server (issuer `https://pcb.dog`)
- Scopes: `quote:read`, `gerber:analyze`, `lead:write`. Bearer tokens go in the `Authorization` header.

## Registration (anonymous)

Claim a bearer token without any identity:

```
curl -X POST https://pcb.dog/api/agent/claim
```

`POST /api/agent/token` with `grant_type=client_credentials` behaves the same; no client authentication is required (`token_endpoint_auth_methods_supported: ["none"]`).

## agent_auth

As served in both metadata documents above:

```json
{
  "agent_auth": {
    "skill": "https://pcb.dog/auth.md",
    "register_uri": "https://pcb.dog/api/agent/claim",
    "claim_uri": "https://pcb.dog/api/agent/claim",
    "identity_types_supported": ["anonymous"],
    "anonymous": {
      "credential_types_supported": ["bearer_token"],
      "claim_uri": "https://pcb.dog/api/agent/claim"
    }
  }
}
```

Tokens are issued for forward compatibility: they are accepted but not yet required or validated, and every endpoint keeps working without one. If a token ever becomes required, this file and the metadata above will announce the change before anything is enforced.

Docs: https://pcb.dog/en/agents | OpenAPI: https://pcb.dog/openapi.json | Catalog: https://pcb.dog/.well-known/api-catalog
