# API and AI agents

Everything the site does is available as plain HTTP, without an API key: USD quotes, Gerber pre-checks, orders, and saving a quote with an e-mail. Prices are computed from the same tables as the site.

## API

- Quote (no key): `GET https://pcb.dog/api/quote?layers=4&width_mm=100&height_mm=100&qty=5`
- Gerber pre-check: `POST https://pcb.dog/api/analyze` (multipart, field "file", one .zip up to 25 MB)
- Order: `POST https://pcb.dog/api/orders` with the pre-check id, tier, ship_to and email, then `POST https://pcb.dog/api/orders/{order_id}/confirm` once the person approves the summary
- Save a quote: `POST https://pcb.dog/api/leads` with kind="quote" (see https://pcb.dog/openapi.json)
- Agent guide: https://pcb.dog/en/agents | llms.txt: https://pcb.dog/llms.txt

## How an order works

1. Pre-check the Gerber .zip: POST /api/analyze or analyze_gerbers. You get an id, the layer count and board size read from the file, and any DFM findings.
2. Create the order: POST /api/orders or create_order with the id, a tier, the quantity, the shipping address and the person's e-mail. The reply is a summary with the USD total, the delivery date, a preview of the board and an order_id. Nothing is charged; the draft is kept for 24 hours.
3. Show the summary and the preview to the person and get their approval.
4. Confirm: POST /api/orders/{order_id}/confirm or confirm_order. The reply says whether the order was accepted. A repeated confirm returns the same answer and never places a second order.

## Payment

The person pays, not the agent. An accepted order's reply carries a payment link for the person to open. The agent never sees card details and needs no API key, account or crypto wallet. Prices are in USD and final; US and EU shipments include duties.

API catalog (RFC 9727): https://pcb.dog/.well-known/api-catalog | auth: https://pcb.dog/auth.md
