# Account — QuanticData API

> Account endpoints of the QuanticData API with parameters, request and response examples in cURL, Python, Node.js and PHP. Part of https://quanticdata.io/docs/index.md.

Base URL `https://api.quanticdata.io/v1` · Auth `Authorization: Bearer qd_live_…` · HTML: https://quanticdata.io/docs/ · OpenAPI: https://quanticdata.io/docs/openapi.json · All endpoints: https://quanticdata.io/docs/llms.txt · This file: https://quanticdata.io/docs/account.md

_Generated from openapi.json v2026-10-29 on 2026-10-19; prices and limits as of 2026-10-19_

## Account

Usage, billing status and platform settings.

### Per-day usage and cost

`GET /scraper/usage`

**Price:** No charge.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Request counts (total and per query type), proxy bandwidth, AI token cost and billed vs free-tier spend per UTC day for the calling key's account, read from the daily aggregation. Free; not subject to the Data API kill switch.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `days` | query | integer | no |  Default `30`. |

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/scraper/usage' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/scraper/usage',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/scraper/usage", {
  method: "GET",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY"
  }
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/scraper/usage');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY'],
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — Usage report.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `429` — Key rate limit (hourly window), plan per-minute budget, browser-render concurrency, or pool capacity. Back off on Retry-After.

Example `200` response:

```json
{
  "type": "response",
  "message": "Scraper usage",
  "payload": {
    "days": [
      {
        "date": "2026-10-06",
        "requests": 143,
        "by_type": {
          "extract": 120,
          "google": 20,
          "map": 3
        },
        "proxy_kb": 61230,
        "ai_cost_usd": 0,
        "billed_usd": 0,
        "free_usd": 0.0375
      }
    ],
    "totals": {
      "requests": 143,
      "by_type": {
        "extract": 120,
        "google": 20,
        "map": 3
      },
      "proxy_kb": 61230,
      "billed_usd": 0,
      "free_usd": 0.0375
    },
    "period_days": 30
  },
  "pagination": {}
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `429`:

```json
{
  "type": "error",
  "message": "Rate limit exceeded. Resets in 23 minutes.",
  "payload": {
    "rateLimit": 1200,
    "requestCount": 1200,
    "resetAt": "2026-10-07T15:00:00.000Z"
  }
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Billing status and your price list

`GET /scraper/billing`

**Price:** No charge.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Current price list with your tier's discount applied (keyed like pricing.json), monthly free allowance and what is left of it, wallet balance, active tier, billing mode and the per-minute limits each mode carries. Lets a client or an agent budget its calls without a dashboard round-trip. Free; not subject to the Data API kill switch.

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/scraper/billing' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/scraper/billing',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/scraper/billing", {
  method: "GET",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY"
  }
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/scraper/billing');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY'],
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — Billing status.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `429` — Key rate limit (hourly window), plan per-minute budget, browser-render concurrency, or pool capacity. Back off on Retry-After.

Example `200` response:

```json
{
  "type": "response",
  "message": "Billing status",
  "payload": {
    "billing_enabled": true,
    "billed": true,
    "balance": 12.5,
    "tier": {
      "key": "payg",
      "name": "Pay as you go",
      "discount_pct": 0,
      "rate_limit_per_min": 20
    },
    "billing_mode": {
      "preference": "free_first",
      "effective": "free_first",
      "available": true,
      "free_first_rate_limit_per_min": 20,
      "balance_rate_limit_per_min": 300,
      "effective_rate_limit_per_min": 20
    },
    "free_monthly_usd": 2,
    "free_remaining_usd": 1.62,
    "ai_token_markup": 2,
    "prices_usd": {
      "extract": 0.0015,
      "extract_render": 0.0025,
      "serp": 0.0009,
      "serp_render": 0.002,
      "map": 0.003,
      "seo_audit": 0.003,
      "crawl_page": 0.0003,
      "batch_url": 0.0004,
      "collector_result": 0.002
    }
  },
  "pagination": {}
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `429`:

```json
{
  "type": "error",
  "message": "Rate limit exceeded. Resets in 23 minutes.",
  "payload": {
    "rateLimit": 1200,
    "requestCount": 1200,
    "resetAt": "2026-10-07T15:00:00.000Z"
  }
}
```

Try it: https://app.quanticdata.io/data-api/playground

### No-key MCP trial settings

`GET /mcp/trial-config`

**Price:** No charge.  
**Rate limit:** No rate limit.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

What the keyless trial of the hosted MCP endpoint allows right now for a brand: whether it is on, calls per client address per UTC day, calls across all addresses per day, and which tools it may run. Read by the hosted MCP servers once a minute; nothing secret in it, so it needs no API key and is cacheable for 60 s. The brand comes from `?brand=` or, failing that, from the request host.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `brand` | query | string: `QP`, `QD` | no | QP = QuantumProxies, QD = QuanticData. Defaults to the brand of the host you call. |

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/mcp/trial-config'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/mcp/trial-config',
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/mcp/trial-config", {
  method: "GET"
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/mcp/trial-config');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — Trial settings.

Example `200` response:

```json
{
  "type": "response",
  "message": "ok",
  "payload": {
    "brand": "QD",
    "enabled": true,
    "perIpPerDay": 5,
    "perDay": 300,
    "tools": [
      "scrape",
      "search",
      "search_and_read",
      "map",
      "seo_audit",
      "list_collectors",
      "collector_run_status",
      "proxy_locations"
    ]
  }
}
```

Try it: https://app.quanticdata.io/data-api/playground

## Agents

Endpoints for an AI agent acting for a person: self-registration with a verified email (no browser, no password, no captcha; the person only reads a 6-digit code from their mailbox) and a checkout in the Universal Commerce Protocol (UCP) shape to buy a proxy plan, paid from the account balance by the agent or finished by the person on the dashboard. Discovery documents: `agent_auth` in `https://app.quanticdata.io/.well-known/oauth-authorization-server`, the UCP profile at `https://api.quanticdata.io/.well-known/ucp` (also on the dashboard host and the site), and the plain-text guide at `https://quanticdata.io/auth.md`. Registration and claim answer OAuth-style JSON (`error`, `error_description`), not the Data API envelope; the checkout answers UCP documents.

**How an agent pays a top-up without a human (MPP, Stripe).** Every call made with an API key that answers 402 `INSUFFICIENT_FUNDS` (free allowance plus balance below the call's worst-case estimate) also carries a payment challenge in the HTTP Payment authentication scheme (paymentauth.org drafts draft-httpauth-payment-01 and draft-stripe-charge-00; method `stripe`, intent `charge`). The payment buys credit on the account balance, never the single call: no price changes, and the call is then billed from the balance at list price like any other.

1. The 402 carries `WWW-Authenticate: Payment id="…", realm="api.quanticdata.io", method="stripe", intent="charge", request="<base64url JSON {amount, currency:"usd", decimals:2, methodDetails:{networkId, paymentMethodTypes}}>", expires="<RFC 3339>", description="…", opaque="…"`. `amount` is in cents and already includes 22% VAT (a $5.00 credit reads `"610"`). The body is the usual error envelope with `estimated_cost`, `balance` and `free_remaining`.
2. The credit offered is the call's shortfall rounded up to the cent, never below $0.50 and never above $1,000 per request. Above $1,000 the challenge offers $1,000 and the envelope also carries `escalation`: the agent asks for a higher limit at `POST /agent/contact`.
3. The agent obtains a Stripe Shared Payment Token (`spt_…`) for that amount from its payment provider and repeats the same request with `Authorization: Payment <credential>` (or `Payment-Authorization: Payment <credential>`), where `<credential>` is base64url JSON `{"challenge": {…the challenge parameters, id to opaque, unchanged…}, "payload": {"spt": "spt_…"}}`. The challenge is valid 5 minutes and single use.
4. QuanticData charges the token at once, credits the balance, writes a numbered top-up invoice (the credit as taxable amount, 22% VAT, total = the amount charged) and emails it to the account, then runs the call from the balance. The response, whatever the call's own status, carries `Payment-Receipt` (base64url JSON `{status:"success", method:"stripe", reference:"pi_…", timestamp}`), `X-MPP-Credited` (credit added, in cents) and `X-MPP-Invoice` (the invoice id). The credit stays on the balance even if the call itself fails: a failed call is not billed.
5. If the credit cannot be added after the charge, the payment is refunded in full. Payment errors come back as `application/problem+json` (`type` under `https://paymentauth.org/problems/`): 402 `payment-expired` and `verification-failed` (a declined token) with a fresh challenge to pay, `malformed-credential`, `invalid-payload` and `invalid-challenge` (repeat the request with the API key to get a new challenge), `payment-action-required` (the token needs a step an agent cannot do); 403 `invalid-challenge` for a credential already used; 429 `mpp_limit` with `Retry-After` beyond 30 payments a minute or 2,000 a day per account, or 60 a minute per IP.

No challenge without an API key (there is no account to credit), none on `BUDGET_REACHED` (the monthly spend cap the person set: a top-up would not lift it) and none on a plan purchase's `INSUFFICIENT_BALANCE`, where the checkout's `continue_url` remains the way. The person sees every top-up, invoice and ledger row on the dashboard and can revoke the key at any time.

**When a 402 carries `escalation`.** `POST /agent/contact` (same API key) reaches the team when a 402 carries `escalation` (credit above the top-up limit, monthly budget cap reached) or when the person wants an enterprise plan or a dataset; the team answers that person by email, nothing is charged.

### Register an agent with a verified email (step 1 of 2)

`POST /agent/auth`

**Price:** No charge.  
**Rate limit:** Per IP: 5 registrations an hour, 20 a day. Per email: 3 codes an hour. Per registrable email domain: 10 a day. A global daily cap across both brands. Exceeded limits answer 429 `rate_limited` with `Retry-After`.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Starts the registration of an account for the person the agent works for (the `register_uri` of the `agent_auth` block in the OAuth metadata). The agent sends that person's email address; QuanticData emails them a 6-digit code (subject "… is your QuanticData verification code — an AI agent asked to register"); the person reads it to the agent; the agent exchanges it at `POST /agent/auth/claim` for an API key. No password, no browser, no captcha. Tell the user which service you are registering with before calling. The answer is the same `pending` document whether or not an account already exists for that email: the code goes to the mailbox owner, and a confirmed claim adds a key to the existing account instead of opening a new one. The code lives 10 minutes; 5 wrong codes cancel the registration; at most 3 codes per email per hour. Not offered: anonymous registration (400 `anonymous_not_enabled`) and identity assertions (ID-JAG, 400). Temporary or unreachable mailboxes answer 422 `invalid_email`. A registration that the risk checks want a person to finish answers 428 `human_verification_required` with `register_human`: ask the user to register in the browser and hand you a key from the API keys page. When the switch is off the endpoint answers 503 `agent_registration_disabled`. Also served at `https://app.quanticdata.io/api/v1/agent/auth`. Errors are OAuth-style JSON (`error`, `error_description`), not the Data API envelope. No API key: this call creates one.

#### Request body (required)

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `method` | string: `verified_email` | no | The only method offered. `{"type": "service_auth", "login_hint": "…"}` is accepted as an alias of `{"method": "verified_email", "email": "…"}`. Default `"verified_email"`. |
| `email` | string (email) | yes | The person's permanent email address: it receives the code, and later invoices and API alerts. |
| `agent` | object | no | Who is registering (optional). Shown in the verification email and in the key's name on the dashboard. |
| `agent.name` | string | no | Printable characters only; trimmed to a short label. |
| `agent.url` | string (uri) | no | http(s) URL of the agent or its operator. |

Example:

```json
{
  "method": "verified_email",
  "email": "user@example.com",
  "agent": {
    "name": "Research agent",
    "url": "https://example.com/agent"
  }
}
```

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/auth' \
  -H 'Content-Type: application/json' \
  -d '{"method":"verified_email","email":"user@example.com","agent":{"name":"Research agent","url":"https://example.com/agent"}}'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/auth',
    json={
        "method": "verified_email",
        "email": "user@example.com",
        "agent": {
            "name": "Research agent",
            "url": "https://example.com/agent"
        }
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/auth", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "method": "verified_email",
    "email": "user@example.com",
    "agent": {
      "name": "Research agent",
      "url": "https://example.com/agent"
    }
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/auth');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'method' => 'verified_email',
    'email' => 'user@example.com',
    'agent' => [
      'name' => 'Research agent',
      'url' => 'https://example.com/agent'
    ]
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — Code sent. Ask the user for the 6 digits, then call `claim_uri`.
- `400` — Missing or invalid field, or a method that is not offered (`anonymous_not_enabled`, identity assertions).
- `422` — Temporary or unreachable mailbox.
- `428` — A person has to finish this registration in the browser.
- `429` — A cap was reached; wait `retry_after` seconds.
- `503` — Agent registration is switched off (`agent_registration_disabled`), or the code email could not be sent right now (`temporarily_unavailable`).

Example `200` response:

```json
{
  "status": "pending",
  "registration_type": "verified_email",
  "claim_uri": "https://app.quanticdata.io/api/v1/agent/auth/claim",
  "expires_in": 600,
  "interval": 0,
  "message": "A 6-digit verification code was emailed to user@example.com. Ask your user for it, then POST {\"email\": \"user@example.com\", \"code\": \"<6 digits>\"} to claim_uri. The API key is returned once, in that response."
}
```

Example `400`:

```json
{
  "error": "anonymous_not_enabled",
  "error_description": "Anonymous registration is not offered: register with a verified email (method \"verified_email\").",
  "auth_md": "https://quanticdata.io/auth.md"
}
```

Example `422`:

```json
{
  "error": "invalid_email",
  "error_description": "Temporary or unreachable mailboxes are not accepted. Register with a permanent email address that can receive invoices and API alerts.",
  "register_human": "https://app.quanticdata.io/register"
}
```

Example `428`:

```json
{
  "error": "human_verification_required",
  "error_description": "This registration needs a person to complete it. Ask your user to open register_human, create the account and an API key in the dashboard, then give you the key.",
  "register_human": "https://app.quanticdata.io/register",
  "auth_md": "https://quanticdata.io/auth.md"
}
```

Example `429`:

```json
{
  "error": "rate_limited",
  "error_description": "Too many agent registrations from this address. Retry after 3600 seconds.",
  "retry_after": 3600
}
```

Example `503`:

```json
{
  "error": "agent_registration_disabled",
  "error_description": "Automated agent registration is switched off right now. A person can register at register_human and create an API key in the dashboard.",
  "register_human": "https://app.quanticdata.io/register",
  "auth_md": "https://quanticdata.io/auth.md"
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Exchange the emailed code for an API key (step 2 of 2)

`POST /agent/auth/claim`

**Price:** No charge.  
**Rate limit:** 30 claim attempts per IP an hour (429 `rate_limited` with `Retry-After`); 5 wrong codes per registration.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

The `claim_uri` of the `agent_auth` block. With the right code the pending registration is consumed before anything is created, so two concurrent claims yield one key. A new account is born verified, on the standard pay-as-you-go tier, with a random password nobody knows: the person signs in to the dashboard through the password reset link. An existing account simply gets a new key. The key is returned once in this response and is never emailed; the person can see, rotate or revoke it on the API keys page. Codes: 6 digits, spaces and dashes ignored (`user_code` accepted as an alias of `code`). A wrong code answers 400 `invalid_code` with `attempts_remaining`; the fifth wrong code cancels the registration (429 `too_many_attempts`); no pending registration, an expired code or a second claim answers 410 `claim_expired`: start again at `POST /agent/auth`. Also served at `https://app.quanticdata.io/api/v1/agent/auth/claim`. OAuth-style error bodies.

#### Request body (required)

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string (email) | yes | The same address as in step 1. |
| `code` | string | yes | The 6 digits from the email. |

Example:

```json
{
  "email": "user@example.com",
  "code": "482913"
}
```

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/auth/claim' \
  -H 'Content-Type: application/json' \
  -d '{"email":"user@example.com","code":"482913"}'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/auth/claim',
    json={
        "email": "user@example.com",
        "code": "482913"
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/auth/claim", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "email": "user@example.com",
    "code": "482913"
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/auth/claim');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'email' => 'user@example.com',
    'code' => '482913'
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The API key, once.
- `400` — Wrong code (`invalid_code`, with the attempts left) or a malformed body (`invalid_request`).
- `410` — No pending registration for this email, the code expired, or the registration was already claimed.
- `429` — Fifth wrong code (`too_many_attempts`, the registration is cancelled) or too many claims from this IP (`rate_limited`).
- `503` — Agent registration is switched off.

Example `200` response:

```json
{
  "credential_type": "api_key",
  "api_key": "qd_live_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "key_prefix": "qd_live_0123",
  "account_status": "created",
  "email": "user@example.com",
  "usage": {
    "header": "Authorization: Bearer <api_key>",
    "api_base": "https://api.quanticdata.io/v1"
  },
  "docs": "https://quanticdata.io/docs/",
  "auth_md": "https://quanticdata.io/auth.md",
  "note": "This key is shown once and is not sent by email. Store it in an environment variable. Your user can see, rotate or revoke it from the dashboard (API keys page)."
}
```

Example `400`:

```json
{
  "error": "invalid_code",
  "error_description": "Wrong verification code.",
  "attempts_remaining": 4
}
```

Example `410`:

```json
{
  "error": "claim_expired",
  "error_description": "No pending registration for this email, or the code expired. Start again at register_uri.",
  "register_uri": "https://app.quanticdata.io/api/v1/agent/auth"
}
```

Example `429`:

```json
{
  "error": "too_many_attempts",
  "error_description": "Too many wrong codes: this registration was cancelled. Start again at register_uri.",
  "register_uri": "https://app.quanticdata.io/api/v1/agent/auth"
}
```

Example `503`:

```json
{
  "error": "agent_registration_disabled",
  "error_description": "Automated agent registration is switched off right now. A person can register at register_human and create an API key in the dashboard.",
  "register_human": "https://app.quanticdata.io/register",
  "auth_md": "https://quanticdata.io/auth.md"
}
```

Try it: https://app.quanticdata.io/data-api/playground

### UCP discovery profile

`GET /agent/ucp`

**Price:** No charge.  
**Rate limit:** No rate limit.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

The Universal Commerce Protocol profile of QuanticData (ucp.dev, version 2026-08-25): the `dev.ucp.shopping` service with its REST endpoint, the `dev.ucp.shopping.checkout` capability, and the one payment handler an agent can use by itself, the prepaid account balance (`balance`). The same document is served at `https://api.quanticdata.io/.well-known/ucp`, `https://app.quanticdata.io/.well-known/ucp` and `https://quanticdata.io/.well-known/ucp`, with `Cache-Control: public`. The flat aliases at the root (`protocol_version`, `services`, `capabilities`, `endpoints`) repeat the `ucp` block for scanners that read them there. No key needed.

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/agent/ucp'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/agent/ucp',
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp", {
  method: "GET"
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The profile.

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "services": {
      "dev.ucp.shopping": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/overview/",
          "schema": "https://ucp.dev/2026-08-25/services/shopping/rest.openapi.json",
          "transport": "rest",
          "endpoint": "https://api.quanticdata.io/v1/agent/ucp"
        }
      ]
    },
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "keys": [],
  "endpoints": {
    "checkout_sessions": "https://api.quanticdata.io/v1/agent/ucp/checkout-sessions",
    "openapi": "https://api.quanticdata.io/openapi.json",
    "catalog": "https://api.quanticdata.io/v1/public/plans",
    "docs": "https://quanticdata.io/docs/"
  }
}
```

Try it: https://app.quanticdata.io/data-api/playground

### JSON Schema of the balance payment instrument

`GET /agent/ucp/handlers/balance.json`

**Price:** No charge.  
**Rate limit:** No rate limit.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

The instrument an agent passes to complete a checkout from the account balance: `{"handler_id": "balance", "type": "account_balance"}`. No credential travels with it, the API key of the request is the authorization. Linked from the UCP profile. No key needed.

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json',
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json", {
  method: "GET"
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — JSON Schema (draft 2020-12).

Example `200` response:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
  "title": "QuanticData account balance payment instrument",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "handler_id": {
      "type": "string",
      "const": "balance"
    },
    "type": {
      "type": "string",
      "const": "account_balance"
    },
    "selected": {
      "type": "boolean"
    }
  },
  "required": [
    "handler_id",
    "type"
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Create a checkout session for one plan

`POST /agent/ucp/checkout-sessions`

**Price:** No charge. Creating a session is free; the plan costs its `amount` from `GET /public/plans`, charged only when the session is completed.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Create Checkout of the UCP REST binding. The agent names one public plan (`line_items[0].item.id` from `GET /public/plans`, quantity 1) and gets back the real price: list price from the catalog, VAT by the same rule as the human checkout (0% for `BALANCE` and `NOWPAYMENTS`, 22% for `PAYPAL` and `PAYPAL_CARD`). The declared `payment_method` only decides the VAT in the quote. Status on creation: `ready_for_complete` when the method is `BALANCE` and the balance covers the total (complete it with `POST /agent/ucp/checkout-sessions/{id}/complete`), otherwise `requires_escalation` with a `continue_url` where the person pays on the dashboard; poll `GET /agent/ucp/checkout-sessions/{id}` until `completed`. A session expires after 6 hours. ISP plans are configured per order and are not sold here (400 `plan_not_sellable_here`: use the dashboard or the Premium ISP and IPv6 endpoints); trial-only and custom plans are not public (404 `plan_not_found`). Send an `Idempotency-Key` header (8–128 letters, digits, `_ . : -`) to make retries safe: the same key answers 200 with the session already created. The plainer alternative without the UCP shape is `POST /public/purchase`. Authentication: the API key of the buying account, as `Authorization: Bearer` or `X-API-Key`. Errors are UCP documents.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Optional. 8–128 characters among letters, digits, `_`, `.`, `:` and `-`. The same key from the same account answers 200 with the existing session instead of creating another. |

#### Request body (required)

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `line_items` | array of object | yes |  |
| `line_items[].item` | object | yes |  |
| `line_items[].quantity` | integer | no |  Default `1`. |
| `buyer` | object | no |  |
| `buyer.email` | string (email) | no | Optional, echoed in the document. |
| `payment_method` | string: `BALANCE`, `NOWPAYMENTS`, `PAYPAL`, `PAYPAL_CARD` | no | What the quote assumes. `BALANCE` is the only one the agent can complete; the others are paid by a person at `continue_url`. Default `"BALANCE"`. |

Example:

```json
{
  "line_items": [
    {
      "item": {
        "id": "pln_3e7a"
      },
      "quantity": 1
    }
  ],
  "buyer": {
    "email": "user@example.com"
  },
  "payment_method": "BALANCE"
}
```

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"line_items":[{"item":{"id":"pln_3e7a"},"quantity":1}],"buyer":{"email":"user@example.com"},"payment_method":"BALANCE"}'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    json={
        "line_items": [
            {
                "item": {
                    "id": "pln_3e7a"
                },
                "quantity": 1
            }
        ],
        "buyer": {
            "email": "user@example.com"
        },
        "payment_method": "BALANCE"
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/checkout-sessions", {
  method: "POST",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "line_items": [
      {
        "item": {
          "id": "pln_3e7a"
        },
        "quantity": 1
      }
    ],
    "buyer": {
      "email": "user@example.com"
    },
    "payment_method": "BALANCE"
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/checkout-sessions');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'line_items' => [[
      'item' => [
        'id' => 'pln_3e7a'
      ],
      'quantity' => 1
    ]],
    'buyer' => [
      'email' => 'user@example.com'
    ],
    'payment_method' => 'BALANCE'
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — Replay of an `Idempotency-Key` already used: the existing session.
- `201` — Session created.
- `400` — Malformed request: `invalid_json`, `one_item_only`, `invalid_item`, `quantity_not_supported`, `invalid_payment_method`, `plan_not_sellable_here` (ISP plans).
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `404` — No public plan with that id.
- `503` — The checkout store is not available on this host (`not_provisioned`).

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "success",
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "spec": "https://quanticdata.io/docs/#section/Agent-checkout-(UCP)",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "id": "chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "status": "ready_for_complete",
  "currency": "USD",
  "expires_at": "2026-10-26T18:00:00.000Z",
  "line_items": [
    {
      "id": "li_pln_3e7a",
      "item": {
        "id": "pln_3e7a",
        "title": "Residential - Quark (5GB)",
        "price": 1200
      },
      "quantity": 1,
      "totals": [
        {
          "type": "subtotal",
          "amount": 1200
        },
        {
          "type": "total",
          "amount": 1200
        }
      ]
    }
  ],
  "totals": [
    {
      "type": "subtotal",
      "amount": 1200
    },
    {
      "type": "total",
      "amount": 1200
    }
  ],
  "payment": {
    "instruments": [
      {
        "id": "balance",
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ],
    "declared_method": "BALANCE"
  },
  "continue_url": "https://app.quanticdata.io/plans?network=RESIDENTIAL&utm_source=agent&utm_medium=ucp&utm_campaign=checkout-session&agent_checkout=chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "links": [
    {
      "type": "privacy_policy",
      "url": "https://quanticdata.io/privacy"
    },
    {
      "type": "terms_of_service",
      "url": "https://quanticdata.io/terms"
    }
  ],
  "messages": [
    {
      "type": "info",
      "code": "balance_available",
      "content": "The account balance covers this checkout. Complete it with POST /checkout-sessions/chk_7d3f0a9b2c4e1f6a8b9c0d1e/complete and payment.instruments[0].handler_id = \"balance\" (0% VAT)."
    },
    {
      "type": "info",
      "code": "vat_rule",
      "content": "Totals carry 0% VAT (balance or crypto). Paying by card or PayPal on the dashboard adds 22% VAT."
    }
  ],
  "created_at": "2026-10-26T12:00:00.000Z",
  "updated_at": "2026-10-26T12:00:00.000Z"
}
```

Example `400`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "plan_not_sellable_here",
      "content": "ISP plans are configured per order (IPs, region, days): buy them on the dashboard.",
      "severity": "fatal",
      "path": "$.line_items[0].item.id"
    }
  ]
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `404`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "plan_not_found",
      "content": "No public plan with that id.",
      "severity": "fatal",
      "path": "$.line_items[0].item.id"
    }
  ]
}
```

Example `503`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "not_provisioned",
      "content": "Agent checkout sessions are not provisioned on this host yet.",
      "severity": "fatal"
    }
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Read a checkout session

`GET /agent/ucp/checkout-sessions/{id}`

**Price:** No charge.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Get Checkout. Reading refreshes the state: if the person has paid that plan on the dashboard since the session was created, the session becomes `completed` with the `order`; if the 6 hours have passed, it becomes `canceled`. Poll this after handing `continue_url` to the person. Authentication: the API key of the buying account, as `Authorization: Bearer` or `X-API-Key`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Session id (`chk_` + 24 hex). A session of another account answers 404. |

#### Examples

**curl**

```bash
curl -X GET 'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY'
```

**Python (requests)**

```python
import requests

r = requests.get(
    'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID", {
  method: "GET",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY"
  }
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY'],
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The session document.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `404` — Unknown session, or not this account's.

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "success",
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "spec": "https://quanticdata.io/docs/#section/Agent-checkout-(UCP)",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "id": "chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "status": "ready_for_complete",
  "currency": "USD",
  "expires_at": "2026-10-26T18:00:00.000Z",
  "line_items": [
    {
      "id": "li_pln_3e7a",
      "item": {
        "id": "pln_3e7a",
        "title": "Residential - Quark (5GB)",
        "price": 1200
      },
      "quantity": 1,
      "totals": [
        {
          "type": "subtotal",
          "amount": 1200
        },
        {
          "type": "total",
          "amount": 1200
        }
      ]
    }
  ],
  "totals": [
    {
      "type": "subtotal",
      "amount": 1200
    },
    {
      "type": "total",
      "amount": 1200
    }
  ],
  "payment": {
    "instruments": [
      {
        "id": "balance",
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ],
    "declared_method": "BALANCE"
  },
  "continue_url": "https://app.quanticdata.io/plans?network=RESIDENTIAL&utm_source=agent&utm_medium=ucp&utm_campaign=checkout-session&agent_checkout=chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "links": [
    {
      "type": "privacy_policy",
      "url": "https://quanticdata.io/privacy"
    },
    {
      "type": "terms_of_service",
      "url": "https://quanticdata.io/terms"
    }
  ],
  "messages": [
    {
      "type": "info",
      "code": "balance_available",
      "content": "The account balance covers this checkout. Complete it with POST /checkout-sessions/chk_7d3f0a9b2c4e1f6a8b9c0d1e/complete and payment.instruments[0].handler_id = \"balance\" (0% VAT)."
    },
    {
      "type": "info",
      "code": "vat_rule",
      "content": "Totals carry 0% VAT (balance or crypto). Paying by card or PayPal on the dashboard adds 22% VAT."
    }
  ],
  "created_at": "2026-10-26T12:00:00.000Z",
  "updated_at": "2026-10-26T12:00:00.000Z"
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `404`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "not_found",
      "content": "Unknown checkout session.",
      "severity": "fatal"
    }
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Change the declared payment method or the buyer email

`PUT /agent/ucp/checkout-sessions/{id}`

**Price:** No charge.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Update Checkout (whole-document replacement, as the REST binding). The only things that can change are `payment_method` (which recomputes VAT and the status) and `buyer.email`. The plan is locked: a different `line_items[0].item.id` answers 400 `plan_locked`, open another session instead. A `completed` or `canceled` session answers 409 `session_closed`. Authentication: the API key of the buying account, as `Authorization: Bearer` or `X-API-Key`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Session id (`chk_` + 24 hex). A session of another account answers 404. |

#### Request body (required)

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `line_items` | array of object | no |  |
| `line_items[].item` | object | no |  |
| `buyer` | object | no |  |
| `buyer.email` | string (email) | no |  |
| `payment_method` | string: `BALANCE`, `NOWPAYMENTS`, `PAYPAL`, `PAYPAL_CARD` | no |  |

Example:

```json
{
  "payment_method": "PAYPAL_CARD",
  "buyer": {
    "email": "user@example.com"
  }
}
```

#### Examples

**curl**

```bash
curl -X PUT 'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"payment_method":"PAYPAL_CARD","buyer":{"email":"user@example.com"}}'
```

**Python (requests)**

```python
import requests

r = requests.put(
    'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    json={
        "payment_method": "PAYPAL_CARD",
        "buyer": {
            "email": "user@example.com"
        }
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID", {
  method: "PUT",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "payment_method": "PAYPAL_CARD",
    "buyer": {
      "email": "user@example.com"
    }
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'payment_method' => 'PAYPAL_CARD',
    'buyer' => [
      'email' => 'user@example.com'
    ]
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The updated session.
- `400` — `plan_locked`, `invalid_payment_method` or `invalid_json`.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `404` — Unknown session.
- `409` — The session is completed or canceled.

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "success",
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "spec": "https://quanticdata.io/docs/#section/Agent-checkout-(UCP)",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "id": "chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "status": "ready_for_complete",
  "currency": "USD",
  "expires_at": "2026-10-26T18:00:00.000Z",
  "line_items": [
    {
      "id": "li_pln_3e7a",
      "item": {
        "id": "pln_3e7a",
        "title": "Residential - Quark (5GB)",
        "price": 1200
      },
      "quantity": 1,
      "totals": [
        {
          "type": "subtotal",
          "amount": 1200
        },
        {
          "type": "total",
          "amount": 1200
        }
      ]
    }
  ],
  "totals": [
    {
      "type": "subtotal",
      "amount": 1200
    },
    {
      "type": "total",
      "amount": 1200
    }
  ],
  "payment": {
    "instruments": [
      {
        "id": "balance",
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ],
    "declared_method": "BALANCE"
  },
  "continue_url": "https://app.quanticdata.io/plans?network=RESIDENTIAL&utm_source=agent&utm_medium=ucp&utm_campaign=checkout-session&agent_checkout=chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "links": [
    {
      "type": "privacy_policy",
      "url": "https://quanticdata.io/privacy"
    },
    {
      "type": "terms_of_service",
      "url": "https://quanticdata.io/terms"
    }
  ],
  "messages": [
    {
      "type": "info",
      "code": "balance_available",
      "content": "The account balance covers this checkout. Complete it with POST /checkout-sessions/chk_7d3f0a9b2c4e1f6a8b9c0d1e/complete and payment.instruments[0].handler_id = \"balance\" (0% VAT)."
    },
    {
      "type": "info",
      "code": "vat_rule",
      "content": "Totals carry 0% VAT (balance or crypto). Paying by card or PayPal on the dashboard adds 22% VAT."
    }
  ],
  "created_at": "2026-10-26T12:00:00.000Z",
  "updated_at": "2026-10-26T12:00:00.000Z"
}
```

Example `400`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "plan_locked",
      "content": "The plan of a session cannot change: create a new session.",
      "severity": "fatal",
      "path": "$.line_items[0].item.id"
    }
  ]
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `404`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "not_found",
      "content": "Unknown checkout session.",
      "severity": "fatal"
    }
  ]
}
```

Example `409`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "session_closed",
      "content": "Session is completed.",
      "severity": "fatal"
    }
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Pay the session from the account balance

`POST /agent/ucp/checkout-sessions/{id}/complete`

**Price:** No charge. Charges the plan's `amount` to the balance, 0% VAT. Nothing is charged on a failed outcome.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Complete Checkout. The only instrument an agent holds is the prepaid balance of the account that owns the API key: pass `payment.instruments[0].handler_id = "balance"`. The session is then paid through the same path as `POST /public/purchase`: the balance is charged (0% VAT), the order and the paid invoice are created and the plan is activated in the same call; `order.id` is the `orderId` for `POST /public/proxies/generate`. Outcomes, all with HTTP 200 and the session document: `completed` with `order` and the message `order_created`; `ready_for_complete` again with an `error` message `payment_failed` (the balance no longer covers the total: top up at the dashboard or hand `continue_url` to the person) or `purchase_failed` (recoverable, `content` says why); unchanged with `payment_instrument_unavailable` when another handler was passed (card, PayPal and crypto are paid by a person at `continue_url`). A session that is already `completed` answers 200 with the same order, so retrying is safe; a `canceled` one answers 409 `session_closed`. Authentication: the API key of the buying account, as `Authorization: Bearer` or `X-API-Key`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Session id (`chk_` + 24 hex). A session of another account answers 404. |

#### Request body

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payment` | object | no |  |
| `payment.instruments` | array of object | no |  |

Example:

```json
{
  "payment": {
    "instruments": [
      {
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ]
  }
}
```

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/complete' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"payment":{"instruments":[{"handler_id":"balance","type":"account_balance","selected":true}]}}'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/complete',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    json={
        "payment": {
            "instruments": [
                {
                    "handler_id": "balance",
                    "type": "account_balance",
                    "selected": true
                }
            ]
        }
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/complete", {
  method: "POST",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "payment": {
      "instruments": [
        {
          "handler_id": "balance",
          "type": "account_balance",
          "selected": true
        }
      ]
    }
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/complete');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'payment' => [
      'instruments' => [[
        'handler_id' => 'balance',
        'type' => 'account_balance',
        'selected' => true
      ]]
    ]
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The session after the attempt: `completed` with `order`, or back to `ready_for_complete` with an `error` message.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `404` — Unknown session.
- `409` — The session is canceled.

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "success",
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "spec": "https://quanticdata.io/docs/#section/Agent-checkout-(UCP)",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "id": "chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "status": "completed",
  "currency": "USD",
  "expires_at": "2026-10-26T18:00:00.000Z",
  "line_items": [
    {
      "id": "li_pln_3e7a",
      "item": {
        "id": "pln_3e7a",
        "title": "Residential - Quark (5GB)",
        "price": 1200
      },
      "quantity": 1,
      "totals": [
        {
          "type": "subtotal",
          "amount": 1200
        },
        {
          "type": "total",
          "amount": 1200
        }
      ]
    }
  ],
  "totals": [
    {
      "type": "subtotal",
      "amount": 1200
    },
    {
      "type": "total",
      "amount": 1200
    }
  ],
  "payment": {
    "instruments": [
      {
        "id": "balance",
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ],
    "declared_method": "BALANCE"
  },
  "continue_url": "https://app.quanticdata.io/plans?network=RESIDENTIAL&utm_source=agent&utm_medium=ucp&utm_campaign=checkout-session&agent_checkout=chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "links": [
    {
      "type": "privacy_policy",
      "url": "https://quanticdata.io/privacy"
    },
    {
      "type": "terms_of_service",
      "url": "https://quanticdata.io/terms"
    }
  ],
  "messages": [
    {
      "type": "info",
      "code": "vat_rule",
      "content": "Totals carry 0% VAT (balance or crypto). Paying by card or PayPal on the dashboard adds 22% VAT."
    },
    {
      "type": "info",
      "code": "order_created",
      "content": "Paid from the account balance. The proxy plan is active: see the order permalink."
    }
  ],
  "created_at": "2026-10-26T12:00:00.000Z",
  "updated_at": "2026-10-26T12:01:00.000Z",
  "order": {
    "id": "ord_8c21",
    "permalink_url": "https://app.quanticdata.io/proxies"
  }
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `404`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "not_found",
      "content": "Unknown checkout session.",
      "severity": "fatal"
    }
  ]
}
```

Example `409`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "session_closed",
      "content": "Session is canceled.",
      "severity": "fatal"
    }
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Cancel a checkout session

`POST /agent/ucp/checkout-sessions/{id}/cancel`

**Price:** No charge.  
**Rate limit:** Per API key, by tier (see Rate limits and tiers).  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

Cancel Checkout. A `completed` session cannot be cancelled (409 `already_completed`); cancelling twice is harmless. Nothing is refunded here because nothing was charged. Authentication: the API key of the buying account, as `Authorization: Bearer` or `X-API-Key`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Session id (`chk_` + 24 hex). A session of another account answers 404. |

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/cancel' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/cancel',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/cancel", {
  method: "POST",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY"
  }
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/ucp/checkout-sessions/ID/cancel');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY'],
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `200` — The session, now `canceled`.
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `404` — Unknown session.
- `409` — Already completed.

Example `200` response:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "success",
    "capabilities": {
      "dev.ucp.shopping.checkout": [
        {
          "version": "2026-08-25",
          "spec": "https://ucp.dev/2026-08-25/specification/shopping/checkout/",
          "schema": "https://ucp.dev/2026-08-25/schemas/shopping/checkout.json"
        }
      ]
    },
    "payment_handlers": {
      "io.quanticdata.io.balance": [
        {
          "id": "balance",
          "version": "2026-10-08",
          "spec": "https://quanticdata.io/docs/#section/Agent-checkout-(UCP)",
          "schema": "https://api.quanticdata.io/v1/agent/ucp/handlers/balance.json",
          "available_instruments": [
            {
              "type": "account_balance",
              "currency": "USD"
            }
          ]
        }
      ]
    }
  },
  "id": "chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "status": "canceled",
  "currency": "USD",
  "expires_at": "2026-10-26T18:00:00.000Z",
  "line_items": [
    {
      "id": "li_pln_3e7a",
      "item": {
        "id": "pln_3e7a",
        "title": "Residential - Quark (5GB)",
        "price": 1200
      },
      "quantity": 1,
      "totals": [
        {
          "type": "subtotal",
          "amount": 1200
        },
        {
          "type": "total",
          "amount": 1200
        }
      ]
    }
  ],
  "totals": [
    {
      "type": "subtotal",
      "amount": 1200
    },
    {
      "type": "total",
      "amount": 1200
    }
  ],
  "payment": {
    "instruments": [
      {
        "id": "balance",
        "handler_id": "balance",
        "type": "account_balance",
        "selected": true
      }
    ],
    "declared_method": "BALANCE"
  },
  "continue_url": "https://app.quanticdata.io/plans?network=RESIDENTIAL&utm_source=agent&utm_medium=ucp&utm_campaign=checkout-session&agent_checkout=chk_7d3f0a9b2c4e1f6a8b9c0d1e",
  "links": [
    {
      "type": "privacy_policy",
      "url": "https://quanticdata.io/privacy"
    },
    {
      "type": "terms_of_service",
      "url": "https://quanticdata.io/terms"
    }
  ],
  "messages": [],
  "created_at": "2026-10-26T12:00:00.000Z",
  "updated_at": "2026-10-26T12:00:00.000Z"
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `404`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "not_found",
      "content": "Unknown checkout session.",
      "severity": "fatal"
    }
  ]
}
```

Example `409`:

```json
{
  "ucp": {
    "version": "2026-08-25",
    "status": "error"
  },
  "messages": [
    {
      "type": "error",
      "code": "already_completed",
      "content": "A completed checkout cannot be canceled.",
      "severity": "fatal"
    }
  ]
}
```

Try it: https://app.quanticdata.io/data-api/playground

### Contact the team as an agent (higher credit limit, enterprise, dataset)

`POST /agent/contact`

**Price:** No charge.  
**Rate limit:** Per API key: 3 requests an hour and 10 a day. Per IP address: 10 a day. Beyond that 429 with `Retry-After` and `payload.code` `rate_limited`; the earlier message is already with the team, do not resend it.  
[Try it in the Playground](https://app.quanticdata.io/data-api/playground) · [Markdown for this group](https://quanticdata.io/docs/account.md)

The contact gate for agents. Call it when a 402 carries an `escalation` object (`reason` `amount_above_limit`: the call needs more credit than one card top-up may add, `limit_usd`; `budget_reached`: the account's monthly spend cap is reached), or when the person you work for wants an enterprise plan or a dataset. Send that person's email address: the team answers there by email with a scope and a limit; nothing is charged and nothing changes on the account until they agree. Same API key as every other call (the one created by the agent registration too); no captcha, no browser signals. The message reaches the same inbox as the contact form on the site, marked as coming from an AI agent together with the account and API key ids, so quote the `payload` of the 402 and the numbers you need. One request is enough: a second one with the same content is not answered faster, and the limits below are low on purpose. Errors use the Data API envelope; success is a small receipt document (`202`). Also served at `https://app.quanticdata.io/api/v1/agent/contact`. A person can make the same request at `https://quanticdata.io/enterprise/contact/`.

#### Request body (required)

`Content-Type: application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string (email) | yes | The email address of the person you work for: the team answers there, never to the agent. Temporary mailboxes are refused (400 `invalid_email`). |
| `name` | string | yes | Name of the person, or of the agent acting for them. |
| `subject` | string | yes |  |
| `message` | string | yes | What is needed, with numbers: calls or rows per day, GB per month, countries, deadline. Quote the `payload` of the 402 when there is one. |
| `company` | string | no |  |
| `company_url` | string (uri) | no | http(s) URL of the company. |
| `expected_monthly_usd` | number | no | Expected monthly spend, USD. Helps the team size the limit. |
| `need` | string: `credit_limit`, `enterprise`, `dataset`, `other` | no | `credit_limit` after a 402 with `escalation`; `enterprise` for volumes, SLAs or invoicing; `dataset` for a ready-made or custom dataset. |

Example:

```json
{
  "email": "dana.rossi@example.com",
  "name": "Research agent (for Dana Rossi)",
  "subject": "Higher top-up limit for a weekly SERP job",
  "message": "Weekly job: about 40,000 Google searches in IT and DE, run on Mondays. The 402 estimated $1,812.50 against a balance of $12.50; one top-up is capped at $1,000. Expected monthly spend about $3,500. Please set a limit that lets the job run in one call.",
  "company": "Acme Ltd",
  "company_url": "https://acme.example",
  "expected_monthly_usd": 3500,
  "need": "credit_limit"
}
```

#### Examples

**curl**

```bash
curl -X POST 'https://api.quanticdata.io/v1/agent/contact' \
  -H 'Authorization: Bearer qd_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"email":"dana.rossi@example.com","name":"Research agent (for Dana Rossi)","subject":"Higher top-up limit for a weekly SERP job","message":"Weekly job: about 40,000 Google searches in IT and DE, run on Mondays. The 402 estimated $1,812.50 against a balance of $12.50; one top-up is capped at $1,000. Expected monthly spend about $3,500. Please set a limit that lets the job run in one call.","company":"Acme Ltd","company_url":"https://acme.example","expected_monthly_usd":3500,"need":"credit_limit"}'
```

**Python (requests)**

```python
import requests

r = requests.post(
    'https://api.quanticdata.io/v1/agent/contact',
    headers={"Authorization": "Bearer qd_live_YOUR_API_KEY"},
    json={
        "email": "dana.rossi@example.com",
        "name": "Research agent (for Dana Rossi)",
        "subject": "Higher top-up limit for a weekly SERP job",
        "message": "Weekly job: about 40,000 Google searches in IT and DE, run on Mondays. The 402 estimated $1,812.50 against a balance of $12.50; one top-up is capped at $1,000. Expected monthly spend about $3,500. Please set a limit that lets the job run in one call.",
        "company": "Acme Ltd",
        "company_url": "https://acme.example",
        "expected_monthly_usd": 3500,
        "need": "credit_limit"
    },
    timeout=120,
)
data = r.json()
if data["type"] != "response":
    raise SystemExit(data["message"])
print(data["payload"])
```

**Node (fetch)**

```javascript
const res = await fetch("https://api.quanticdata.io/v1/agent/contact", {
  method: "POST",
  headers: {
    Authorization: "Bearer qd_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "email": "dana.rossi@example.com",
    "name": "Research agent (for Dana Rossi)",
    "subject": "Higher top-up limit for a weekly SERP job",
    "message": "Weekly job: about 40,000 Google searches in IT and DE, run on Mondays. The 402 estimated $1,812.50 against a balance of $12.50; one top-up is capped at $1,000. Expected monthly spend about $3,500. Please set a limit that lets the job run in one call.",
    "company": "Acme Ltd",
    "company_url": "https://acme.example",
    "expected_monthly_usd": 3500,
    "need": "credit_limit"
  })
});
const data = await res.json();
if (data.type !== "response") throw new Error(data.message);
console.log(data.payload);
```

**PHP (curl)**

```php
<?php
$ch = curl_init('https://api.quanticdata.io/v1/agent/contact');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer qd_live_YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'email' => 'dana.rossi@example.com',
    'name' => 'Research agent (for Dana Rossi)',
    'subject' => 'Higher top-up limit for a weekly SERP job',
    'message' => 'Weekly job: about 40,000 Google searches in IT and DE, run on Mondays. The 402 estimated $1,812.50 against a balance of $12.50; one top-up is capped at $1,000. Expected monthly spend about $3,500. Please set a limit that lets the job run in one call.',
    'company' => 'Acme Ltd',
    'company_url' => 'https://acme.example',
    'expected_monthly_usd' => 3500,
    'need' => 'credit_limit'
  ]),
]);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw, true);
if ($data['type'] !== 'response') { throw new RuntimeException($data['message']); }
print_r($data['payload']);
```

#### Responses

- `202` — Received. The team answers the person by email; nothing is charged.
- `400` — Missing or invalid field (`payload.code` `invalid_request`, `payload.field` names it), or a temporary mailbox (`invalid_email`).
- `401` — Missing, malformed, unknown, disabled or expired API key; or the account is not active.
- `429` — A contact cap was reached (per key or per IP). The earlier message is already with the team.
- `500` — Our side: the scraper service is unavailable or the call timed out. Never billed.

Example `202` response:

```json
{
  "type": "response",
  "reference": "cmhcontact0001x9k2agent001",
  "message": "Request received by the QuanticData team (reference cmhcontact0001x9k2agent001).",
  "what_happens_next": "The team answers by email to dana.rossi@example.com with a scope; nothing is charged."
}
```

Example `400`:

```json
{
  "type": "error",
  "message": "\"subject\" must be at most 140 characters.",
  "payload": {
    "code": "invalid_request",
    "field": "subject"
  }
}
```

Example `401`:

```json
{
  "type": "error",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer qd_live_YOUR_API_KEY"
}
```

Example `429`:

```json
{
  "type": "error",
  "message": "Too many contact requests (3 per hour per API key). The team already has your earlier message and answers by email; do not resend it. Retry after 1800 seconds if you have something new to add.",
  "payload": {
    "code": "rate_limited",
    "scope": "per hour per API key",
    "limit": 3,
    "reset_at": "2026-10-29T18:30:00.000Z",
    "retry_after": 1800
  }
}
```

Example `500`:

```json
{
  "type": "error",
  "message": "Scraper service unavailable. Please try again later."
}
```

Try it: https://app.quanticdata.io/data-api/playground
