# MySQLBot > MySQLBot produces verified, cited **research briefs**, **competitor analyses**, and **structured data extracted from documents**, fulfilled by a self-hosted LLM behind a draft → web-verify pipeline. It exposes a plain HTTPS + JSON API designed for autonomous AI agents: create an order, poll its status, and fetch the finished result inline — no browser required. Notes for agents: - **Self-provision, no human:** `POST ?action=register` (no auth) mints your own prepaid `sk_` key with a zero balance and returns a `top_up_url`. A human funds it once; the key then spends its balance per order automatically. - Authenticate with an API key in the `X-Api-Key: sk_...` header on every request. - Order lifecycle: `create_order` → poll `status` → `deliverable` (returned inline as markdown / CSV / JSON; `xlsx` orders additionally get an Excel workbook). Once done, `status` and `deliverable` also return a tokenised `download_url` — one plain GET fetches the finished file (the `.xlsx` workbook, a `.zip` bundle when delivery notes ship alongside, else the plain text file). Check credit with `action=balance`; a low balance returns `402 insufficient_balance` + a `top_up_url`. - **Extraction output controls:** `output_locale` (or `amount_style` + `date_style`) re-presents amounts/dates (values never converted); `output_options` adds clean-up passes (de-duplication, rounding, delimiter, merged-line repair and more). Full detail in the guide §4.1a/§4.1b. - **Delete your data any time:** `POST ?action=delete_data` (body: `ref`) permanently erases an order's document and result — idempotent, no undo, only a bare non-personal payment record kept for tax. Data also auto-deletes 30 days after completion regardless. - **Full account/team management** (parity with the web control panel) is available to a key on a team account: `account`, `list_members`, `invite_member`, `remove_member`, `set_permissions`, `list_keys`, `create_key`, `revoke_key`, `rename_account`, `set_display_name`, `set_password`, `list_orders` — each gated by the key member's permissions. - Responses are a uniform envelope: `{ "ok": , "error": "", "data": { ... } }`. Errors carry a machine-readable `error` code and matching HTTP status. - Fulfilment is asynchronous (a brief typically takes 15-40 min, longer for large documents; small extractions are quicker but multi-MB ones can take hours — `action=quote` returns a measured ETA for your document). Poll every 15-30s. - **Free quote first:** `POST ?action=quote` with the same body as `create_order` returns the exact price, a part count + time estimate, and code-only suitability checks on your document (nothing charged or stored) — call it before funding. - **Free preview (all services):** `POST ?action=preview` runs the REAL engine on a small sample of your document before you pay — extraction returns your first rows; briefs genuinely web-verify 2 sample claims with sources (requires your document text). Rate-capped; works with a zero-balance key. Previews run at HIGH queue priority (they slot between a long job's chunks; extraction ~20-60s, briefs ~1-3 min — use a >=240s read timeout); on `429 rig_busy` honour the `Retry-After` header. `GET ?action=preview_eta` gives a free read-only wait estimate first. ## API - [API guide (for AI agents & developers)](https://mysqlbot.com/pages/public/serviceApiGuide.php?format=md): Complete usage guide — base URL, auth, the create→status→deliverable flow, every field, limits, error table, and curl examples. (Raw markdown; drop `?format=md` for the HTML version.) - [OpenAPI specification](https://mysqlbot.com/openapi.json): Machine-readable OpenAPI 3.0 description of the endpoints and schemas. - [API endpoint](https://mysqlbot.com/pages/public/serviceApi.php): The JSON API itself. Send `X-Api-Key`; a request with no key returns `401 invalid_api_key`. ## Get access - [Client sign-in / sign-up](https://mysqlbot.com/pages/public/client/login.php): Create an account, then generate an API key under **Team → Create key** (shown once). - [Order a service (human web form)](https://mysqlbot.com/pages/public/?page=services): The same services via the website. ## About - [Home](https://mysqlbot.com/pages/public/) - [Contact](https://mysqlbot.com/pages/public/?page=contact) ## Optional - [Terms of use](https://mysqlbot.com/pages/public/?page=tofu) - [Privacy policy](https://mysqlbot.com/pages/public/?page=cookies)