# deepseek-v4.1-flash-heretic — agent guide

OpenAI-compatible chat completions on an uncensored (abliterated) DeepSeek V4.1 Flash.
No account, no signup, no KYC. Pay per request with x402 (USDC on Base), or prepay for a bearer key.

- Base URL: `https://api.flashctx.xyz/v1`
- Model id: `deepseek-v4.1-flash-heretic`
- Machine-readable: `https://api.flashctx.xyz/openapi.json`, `https://api.flashctx.xyz/pricing`, `https://api.flashctx.xyz/.well-known/x402`
- Health: `GET https://api.flashctx.xyz/health` → `{"ok": true, ...}`

## Price

| | per 1M tokens |
|---|---|
| Input | $0.4125 |
| Output | $1.65 |

Flat across the whole context, no long-context surcharge. Currently: launch price — 50% off: half the usual rate while the service fills up; reverts to $0.825 / $3.30 per M.
Minimum charge per x402 request: $0.001.

## Performance (measured on this node, 2026-11-11)

| Workload | Result |
|---|---|
| Prefill, single stream | 4.5k tok/s at 7K prompt, 8.4k at 28K, 10.8k at 85K |
| Time to first token | 0.24 s short prompt, 1.6 s at 7K, 3.4 s at 28K, 7.9 s at 85K |
| Decode, one stream | ~37 tok/s (300-400 token answers) |
| Decode, aggregate | ~112 tok/s at 4 concurrent, ~188 tok/s at 8 concurrent |

Plain streaming completions, no speculative decoding. Long prompts raise prefill; busy seats split
the aggregate.

## Payment rails

| Rail | Minimum | Notes |
|---|---|---|
| x402 (USDC on Base) | $0.001/request | per-request, no account |
| Prepaid USDC (Base) / BTC | $1 | invoice + claim token |
| Card (Stripe-hosted, via PayGate) | $6 | name, DOB and address are collected by the provider |
| Telegram Stars (`@hermes_zne67aiack7jil77_bot`) | $1 | **+35% price offset** — Telegram and the app stores keep ~a third, so $5 of credit costs the star equivalent of $6.75 |

## Quick start (prepaid or trial key)

```python
from openai import OpenAI
c = OpenAI(base_url="https://api.flashctx.xyz/v1", api_key="sk-...", timeout=600)
for chunk in c.chat.completions.create(model="deepseek-v4.1-flash-heretic", stream=True,
        messages=[{"role": "user", "content": "hello"}], max_tokens=2048):
    print(chunk.choices[0].delta.content or "", end="")
```

Free trial: `POST https://api.flashctx.xyz/trial` (no body) → `{"key": "sk-...", "budget_usd": 0.1}`.
One per client per day, limited daily supply.

## Paying

### 1. x402, per request (no account)

1. `POST /v1/chat/completions` with your body and no auth → `402`.
   - v1: JSON body `{"x402Version": 1, "accepts": [...]}`.
   - v2: same status, plus header `PAYMENT-REQUIRED` (base64 JSON, `x402Version: 2`).
2. Sign an `exact` USDC payment (EIP-3009) for the quoted amount:
   network Base mainnet (`base` / `eip155:8453`), asset `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`,
   payTo `0x5Ab610B2C88438548b03511b943BeBF4C324348e`, `maxTimeoutSeconds` 120.
3. Resend the **identical body** with `X-PAYMENT: <base64>` (v1) or `PAYMENT-SIGNATURE: <base64>` (v2).
   The receipt comes back in `X-PAYMENT-RESPONSE` / `PAYMENT-RESPONSE`.

The quote is for *that exact body*: (estimated prompt tokens × input price) + (`max_tokens` × output price).
Change the body (messages, `max_tokens`) and you must fetch a new quote — a v2 payment whose
`accepted` requirements differ from the current quote is rejected before anything is charged.
You pay for `max_tokens` whether or not the model uses them all, so set it to what you need.
Each payment is good for exactly one request (replays → `409`).

Any standard x402 client (e.g. `x402-fetch`, `x402-axios`, `x402` for Python) handles steps 1–3.

### 2. Prepaid bearer key (crypto, $5–$1000)

1. `POST /invoice` `{"rail": "usdc_base" | "btc", "amount_usd": 1}` →
   `{"invoice_id", "claim_token", "pay_exactly", "unit", "address", "expires_in_s"}`.
2. Send **exactly** `pay_exactly` to `address`, in **one** transfer, within 24 h.
   The trailing digits are a unique tag that matches your transfer to your invoice;
   a rounded or split payment is not matched automatically.
3. `POST /claim` `{"claim_token": "ct_..."}` → `{"key": "sk-...", "budget_usd": ...}`.
   Before confirmation it returns `404 payment not confirmed yet` — retry every minute.
   USDC on Base confirms in about a minute; BTC after 2 confirmations.
   Keep the claim token secret: whoever holds it can claim the key.
4. Use the key as `Authorization: Bearer sk-...`. A prepaid key is billed on actual tokens
   used, against its budget.

`rail: "card"` returns a third-party card-to-USDC `checkout_url` instead; credit equals what
actually arrives.

## Limits

| | |
|---|---|
| `max_tokens` | 1–8192, default 512 (`max_completion_tokens` is ignored) |
| Prompt | about 256K tokens (1,048,576 characters) → `413` above that |
| Completions per request | `n` is forced to 1 |
| Images | inline `data:` URIs only; remote image URLs → `400` |
| Concurrency | a few shared seats; a request waits up to 90 s for one, then `429` |

## Speed, streaming and timeouts

- Output runs at roughly 40 tokens/s per request; a full 8K answer takes a few minutes.
- `"stream": true` (server-sent events, OpenAI format) is supported and recommended for long outputs.
- Non-streaming requests work at any length. If the answer is not ready within ~20 s, the
  server sends `200` headers early and keeps the connection alive by sending **spaces before
  the JSON body**. That is valid JSON and every standard client parses it, but:
  - set your HTTP read timeout to **at least 600 s**;
  - on such a slow request an upstream failure arrives as status `200` with an
    `{"error": {...}}` body — check for `error` before reading `choices`.
- This is a reasoning model: `max_tokens` covers reasoning plus the answer. Very small
  `max_tokens` can end (`finish_reason: "length"`) before any answer text; give it room.

## Errors

| Status | Meaning | Charged? |
|---|---|---|
| 400 | bad JSON, bad `max_tokens`, remote image URL, unknown model | no |
| 402 | payment required, or payment rejected (reason in body) | no |
| 409 | x402 payment already used | no (already spent on its first request) |
| 413 | prompt too large | no |
| 422 | bad `/invoice` or `/claim` input | no |
| 429 | no free seat / rate limited / trial already issued — retry later (honour `Retry-After` when sent) | no |
| 503 | model temporarily unavailable — "you were not charged" | no |
| 502 | upstream failed **after** an x402 payment settled; body includes `transaction` | yes — the failure is logged and the operator is alerted automatically; keep the transaction hash |

## Privacy

Prompts and completions are retained for 14 days and are never used for
training. No account or identity is required for any payment method.

## Contact

**`agent_smith@maxxspace.com`** — a human reads it. Also in `https://api.flashctx.xyz/openapi.json` →
`info.contact`. For a payment problem, include the transaction hash or invoice id; for anything
else, describe the request and the time (UTC). The same address is on the landing page.
