Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ECOSYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Want to add an integration? [Open an issue](https://github.com/blockrunai/awesom

| Profile | Strategy | Example Models |
|---------|----------|----------------|
| `free` | Free models only | Step 3.7 Flash (NVIDIA-hosted free tier, no wallet needed) |
| `free` | Free models only | Nemotron 3.5 Lightning (NVIDIA-hosted free tier, no wallet needed) |
| `eco` | Cheapest capable | DeepSeek, Gemini Flash Lite |
| `auto` | Balanced cost/quality | GPT-5 Mini, Gemini Flash |
| `premium` | Best quality | Claude Opus 5, GPT-5.6 Sol |
Expand All @@ -186,7 +186,7 @@ BlockRun routes to these AI providers via x402:
| Qwen | Qwen3.7 Max (1M context, Alibaba flagship), Qwen3.7 Plus, Qwen3.7 Flash | $0.03–$1.48 / $0.13–$4.43 |
| Tencent | Hy3 | $0.132 / $0.528 |
| Xiaomi | MiMo-V2.5 Pro | $0.435 / $0.87 |
| NVIDIA | Step 3.7 Flash, Nemotron 3 Nano Omni, Nemotron Nano 9B v2, Nemotron Nano 12B v2 VL, Mistral Nemotron (5 free models, keyless — no wallet needed) | **Free** |
| Free tier | Nemotron 3 Ultra 550B, Nemotron 3.5 Lightning, Nemotron 3 Nano 30B, Nemotron 3 Nano Omni (vision), Llama 3.2 11B Vision, Cohere North Mini Code, Poolside Laguna XS 2.1 (7 free models, keyless — no wallet needed) | **Free** |

### Image Models

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Real-time prediction market data powered by Predexon:
| **Qwen** | Qwen3.7 Max (1M context, Alibaba flagship), Qwen3.7 Plus, Qwen3.7 Flash | $0.03–$1.48 / $0.13–$4.43 |
| **Tencent** | Hy3 | $0.132 / $0.528 |
| **Xiaomi** | MiMo-V2.5 Pro | $0.435 / $0.87 |
| **NVIDIA** | Step 3.7 Flash, Nemotron 3 Nano Omni, Nemotron Nano 9B v2, Nemotron Nano 12B v2 VL, Mistral Nemotron (5 free models, keyless — no wallet needed) | **Free** |
| **Free tier** | Nemotron 3 Ultra 550B, Nemotron 3.5 Lightning, Nemotron 3 Nano 30B, Nemotron 3 Nano Omni (vision), Llama 3.2 11B Vision, Cohere North Mini Code, Poolside Laguna XS 2.1 (7 free models, keyless — no wallet needed) | **Free** |

### Reasoning

Expand Down Expand Up @@ -290,7 +290,7 @@ Full directory with one line per public repo: [Ecosystem docs](./docs/resources/

| Profile | Strategy | Example Models |
|---------|----------|----------------|
| `free` | Free models only | Step 3.7 Flash (NVIDIA-hosted free tier, no wallet needed) |
| `free` | Free models only | Nemotron 3.5 Lightning (NVIDIA-hosted free tier, no wallet needed) |
| `eco` | Cheapest capable | DeepSeek, Gemini Flash Lite |
| `auto` | Balanced cost/quality | GPT-5 Mini, Gemini Flash |
| `premium` | Best quality | Claude Opus 5, GPT-5.6 Sol |
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: BlockRun is the routing and payment layer for AI agents — one end

**Agents that pay, spend, and trade.**

BlockRun is economic infrastructure for the agent era. AI agents discover services, pay in USDC over the [x402 protocol](x402/how-it-works.md), and execute autonomously — **no API keys, no subscriptions, no credit card.** One funded wallet unlocks 71 LLMs, media generation, real-time data, and on-chain execution.
BlockRun is economic infrastructure for the agent era. AI agents discover services, pay in USDC over the [x402 protocol](x402/how-it-works.md), and execute autonomously — **no API keys, no subscriptions, no credit card.** One funded wallet unlocks 73 LLMs, media generation, real-time data, and on-chain execution.

:::tip{title="In a hurry?"}
Jump to the [5-Minute Quickstart](getting-started/quickstart.md) and make your first paid call.
Expand Down Expand Up @@ -38,7 +38,7 @@ Pick the path that matches how you work.
::::cards

:::card{title="I want an autonomous agent" href="products/franklin.md" icon="Rocket"}
Franklin — the AI agent with a wallet. Writes code and spends USDC across 71 models and paid APIs. Free to start.
Franklin — the AI agent with a wallet. Writes code and spends USDC across 73 models and paid APIs. Free to start.
:::

:::card{title="I use Claude Code / Cursor" href="getting-started/quickstart.md" icon="Terminal"}
Expand All @@ -62,7 +62,7 @@ Four product families, one payment layer.
::::cards

:::card{title="Intelligence" href="products/intelligence/overview.md" icon="Brain"}
71 LLMs (GPT, Claude, Gemini, DeepSeek, Grok, Kimi, Llama) through one OpenAI-compatible API. Pay per request.
73 LLMs (GPT, Claude, Gemini, DeepSeek, Grok, Kimi, Llama) through one OpenAI-compatible API. Pay per request.
:::

:::card{title="Routing" href="products/routing/clawrouter.md" icon="Route"}
Expand Down
8 changes: 5 additions & 3 deletions docs/api-reference/chat-completions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Chat Completions
description: OpenAI-compatible Chat Completions endpoint for 71 LLMs, paid per request in USDC over x402 — no API keys, no subscriptions.
description: OpenAI-compatible Chat Completions endpoint for 73 LLMs, paid per request in USDC over x402 — no API keys, no subscriptions.
---

# Chat Completions
Expand Down Expand Up @@ -172,14 +172,16 @@ WWW-Authenticate: X402 requirements="<same value>"

```json
{
"x402Version": 2,
"accepts": [{"scheme": "exact", "network": "eip155:8453", "amount": "25685", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300}],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": {"amount": "0.025685", "currency": "USD"},
"paymentInfo": {"network": "base", "asset": "USDC", "x402Version": 2}
}
```

`price.amount` is the exact amount the header signs, transaction fee included. Decoded, the header is:
`price.amount` is the exact amount the header signs, transaction fee included. `x402Version`/`accepts` at the top level mirror the header's challenge in the body, for clients that only parse the body. Decoded, the header is:

```json
{
Expand Down Expand Up @@ -328,7 +330,7 @@ console.log(result.choices[0].message.content);
::::cards

:::card{title="Browse all models" href="models.md" icon="Brain"}
71 chat models with live pricing — pick the right model and ID for your call.
73 chat models with live pricing — pick the right model and ID for your call.
:::

:::card{title="Error handling" href="errors.md" icon="Code"}
Expand Down
5 changes: 4 additions & 1 deletion docs/api-reference/defillama.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ DefiLlama does not know is simply absent from `coins` — the call still returns
A request without a payment header returns `402`. The signed requirements are
in the `X-Payment-Required` / `PAYMENT-REQUIRED` headers (and
`WWW-Authenticate: X402 requirements="…"`), and the JSON body restates the
price for humans:
price for humans and mirrors the challenge itself (`x402Version`, `accepts`)
for clients that only read the body:

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "2000", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"endpoint": "/api/v1/defillama/prices/coingecko:bitcoin",
Expand Down
4 changes: 3 additions & 1 deletion docs/api-reference/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ An unknown model is a plain-string error that suggests live IDs:

```json
{
"x402Version": 2,
"accepts": [{"scheme": "exact", "network": "eip155:8453", "amount": "25685", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300}],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": {"amount": "0.025685", "currency": "USD"},
"paymentInfo": {"network": "base", "asset": "USDC", "x402Version": 2}
}
```

The signed requirements travel in the `X-Payment-Required` / `PAYMENT-REQUIRED` headers (and `WWW-Authenticate: X402 requirements="…"`). `price.amount` equals the signed amount, including the flat $0.001 transaction fee.
The signed requirements travel in the `X-Payment-Required` / `PAYMENT-REQUIRED` headers (and `WWW-Authenticate: X402 requirements="…"`), and — since 2026-08-30 — are mirrored at the top level of the JSON body too (`x402Version`, `accepts`), byte-identical to the decoded header. This is for v1-era x402 clients (early `x402-fetch`/`x402-axios` and third-party wrappers) that only parse the body and silently fail to auto-pay when there's no top-level `accepts`. `price.amount` equals the signed amount, including the flat $0.001 transaction fee.

:::info{title="402 is not an error"}
A `402 Payment Required` is part of the normal x402 flow — the gateway is quoting a price. Sign and retry with payment and the SDKs handle this round-trip automatically.
Expand Down
6 changes: 4 additions & 2 deletions docs/api-reference/exa-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,12 @@ Every price above already includes the flat $0.001 per-transaction fee (base $0.

### The 402 response

An unpaid request returns `402` with the exact charge in the body and the signable x402 v2 requirements in the `X-Payment-Required` / `PAYMENT-REQUIRED` headers (base64 JSON; also mirrored in `WWW-Authenticate`). For `/contents` the body is read first, so `price.amount` reflects `urls.length`:
An unpaid request returns `402` with the exact charge in the body and the signable x402 v2 requirements in the `X-Payment-Required` / `PAYMENT-REQUIRED` headers (base64 JSON; also mirrored in `WWW-Authenticate`), plus the same challenge mirrored into the body as `x402Version`/`accepts`. For `/contents` the body is read first, so `price.amount` reflects `urls.length`:

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "5000", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"endpoint": "/api/v1/exa/contents",
Expand Down Expand Up @@ -391,7 +393,7 @@ Real-time web and news search via Grok Live Search.
:::

:::card{title="Chat Completions" href="chat-completions.md" icon="Brain"}
Feed grounded search results into any of 71 LLMs for synthesis.
Feed grounded search results into any of 73 LLMs for synthesis.
:::

:::card{title="Error handling" href="errors.md" icon="Code"}
Expand Down
4 changes: 3 additions & 1 deletion docs/api-reference/image-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,12 @@ billed = catalog rate for the size × n × 1.05 (5% platform margin on media)

### 402 responses

The unpaid `402` is a normal x402 challenge: the signable requirements live in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers (base64 JSON, `x402Version: 2`, `maxTimeoutSeconds: 600`); the body is informational.
The unpaid `402` is a normal x402 challenge: the signable requirements live in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers (base64 JSON, `x402Version: 2`, `maxTimeoutSeconds: 600`), mirrored at the top of the body (`x402Version`, `accepts`) for clients that only read the body; the rest of the body is informational.

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "53500", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 600 }],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": { "amount": "0.053500", "currency": "USD", "pricePerImage": 0.05, "totalImages": 1 },
Expand Down
5 changes: 4 additions & 1 deletion docs/api-reference/modal-sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,13 @@ curl -X POST https://blockrun.ai/api/v1/modal/sandbox/create \

The signed requirements are in the `X-Payment-Required` / `PAYMENT-REQUIRED`
headers (and `WWW-Authenticate: X402 requirements="…"`); the body restates the
price:
price and mirrors the challenge itself (`x402Version`, `accepts`) for clients
that only read the body:

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "11000", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"endpoint": "/api/v1/modal/sandbox/create",
Expand Down
12 changes: 7 additions & 5 deletions docs/api-reference/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,13 @@ Open-weight models served free of charge (no x402 payment), subject to a small p

| Model ID | Name | Input Price | Output Price |
|----------|------|-------------|--------------|
| `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning` | Nemotron 3 Nano Omni | **FREE** | **FREE** |
| `nvidia/mistral-nemotron` | Mistral Nemotron | **FREE** | **FREE** |
| `nvidia/step-3.7-flash` | StepFun Step 3.7 Flash | **FREE** | **FREE** |
| `nvidia/nemotron-nano-9b-v2` | Nemotron Nano 9B v2 | **FREE** | **FREE** |
| `nvidia/nemotron-nano-12b-v2-vl` | Nemotron Nano 12B v2 VL | **FREE** | **FREE** |
| `nvidia/nemotron-3-ultra-550b` | Nemotron 3 Ultra 550B (1M ctx) | **FREE** | **FREE** |
| `nvidia/nemotron-3.5-lightning` | Nemotron 3.5 Lightning (1M ctx) | **FREE** | **FREE** |
| `nvidia/nemotron-3-nano-30b` | Nemotron 3 Nano 30B | **FREE** | **FREE** |
| `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning` | Nemotron 3 Nano Omni (vision) | **FREE** | **FREE** |
| `nvidia/llama-3.2-11b-vision` | Llama 3.2 11B Vision | **FREE** | **FREE** |
| `cohere/north-mini-code` | Cohere North Mini Code (coding) | **FREE** | **FREE** |
| `poolside/laguna-xs-2.1` | Poolside Laguna XS 2.1 (coding) | **FREE** | **FREE** |

### Image Generation

Expand Down
2 changes: 2 additions & 0 deletions docs/api-reference/polymarket-funding.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ curl -X POST https://blockrun.ai/api/v1/polymarket/fund

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "11000", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
"error": "Payment Required",
"message": "This endpoint requires an x402 fee payment ($0.0110). Include the signed deposit authorization in the body.",
"endpoint": "/api/v1/polymarket/fund",
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/realface.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ POST https://blockrun.ai/api/v1/realface/enroll

Same two-step pattern as other paid BlockRun endpoints:

1. First call without `X-Payment` → server returns `402 Payment Required` with x402 challenge headers (`X-Payment-Required` / `PAYMENT-REQUIRED` base64, plus `WWW-Authenticate: X402 requirements="…"`) and a body of `{ "error": "Payment Required", "message": "Enrolling a RealFace asset costs $0.0110 USDC. …", "price": { "amount": "0.0110", "currency": "USD" }, "paymentInfo": { "network": "base", "asset": "USDC", "x402Version": 2 } }`
1. First call without `X-Payment` → server returns `402 Payment Required` with x402 challenge headers (`X-Payment-Required` / `PAYMENT-REQUIRED` base64, plus `WWW-Authenticate: X402 requirements="…"`) and a body of `{ "x402Version": 2, "accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "11000", "payTo": "0x…", "maxTimeoutSeconds": 300 }], "error": "Payment Required", "message": "Enrolling a RealFace asset costs $0.0110 USDC. …", "price": { "amount": "0.0110", "currency": "USD" }, "paymentInfo": { "network": "base", "asset": "USDC", "x402Version": 2 } }` — `x402Version`/`accepts` mirror the header's challenge for clients that only read the body
2. Sign the EIP-3009 transfer authorization for **$0.011 USDC on Base** (`$0.01` enrolment + `$0.001` transaction fee — the requirements say `11000` micro-USDC)
3. Retry the same request with `X-Payment: <base64>` (`Payment-Signature` is accepted too)

Expand Down
4 changes: 3 additions & 1 deletion docs/api-reference/responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ The quote is estimated input tokens plus **10% of `max_output_tokens`** at the m

```json
{
"x402Version": 2,
"accepts": [{"scheme": "exact", "network": "eip155:8453", "amount": "24685", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300}],
"error": {"message": "This endpoint requires x402 payment", "type": "payment_required", "param": null, "code": null},
"price": {"amount": "0.024685", "currency": "USD"},
"paymentInfo": {"network": "base", "asset": "USDC", "x402Version": 2}
}
```

The signed requirements are in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers; the header amount is authoritative and includes the transaction fee, and the body `price.amount` quotes the same fee-inclusive number. A payment that fails verification is a `402` in the same OpenAI envelope — `"Payment verification failed: …"` — and a reused authorization is `402` `"Payment authorization already used — sign a fresh authorization for each request."`; this endpoint keeps OpenAI's error schema rather than the `code` field the native BlockRun endpoints carry. Nothing is charged on either.
The signed requirements are in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers; the header amount is authoritative and includes the transaction fee, and the body `price.amount` quotes the same fee-inclusive number. `x402Version`/`accepts` at the top of the body mirror that header challenge for clients that only read the body — they sit alongside the OpenAI-shaped `error` object, not inside it. A payment that fails verification is a `402` in the same OpenAI envelope — `"Payment verification failed: …"` — and a reused authorization is `402` `"Payment authorization already used — sign a fresh authorization for each request."`; this endpoint keeps OpenAI's error schema rather than the `code` field the native BlockRun endpoints carry. Nothing is charged on either.

## Examples

Expand Down
11 changes: 10 additions & 1 deletion docs/api-reference/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ When you first make a request without payment, you'll receive:

```json
{
"x402Version": 2,
"accepts": [{
"scheme": "exact",
"network": "eip155:8453",
"amount": "263500",
"asset": "0x8335…",
"payTo": "0x…",
"maxTimeoutSeconds": 300
}],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": {
Expand All @@ -90,7 +99,7 @@ When you first make a request without payment, you'll receive:
}
```

The full x402 v2 payment requirements are in the `X-Payment-Required` and `PAYMENT-REQUIRED` headers (base64 JSON, identical content) and in `WWW-Authenticate: X402 requirements="..."`. Sign against the header, not the body: `price.amount` in the body is the per-source cost plus margin **before** the flat $0.001 transaction fee, while `accepts[0].amount` in the header is the exact USDC (6-decimal) amount you will be charged — for the default 10 sources that is `263500`, i.e. $0.2635. Payment authorizations are valid for `maxTimeoutSeconds: 300`.
The full x402 v2 payment requirements are in the `X-Payment-Required` and `PAYMENT-REQUIRED` headers (base64 JSON, identical content) and in `WWW-Authenticate: X402 requirements="..."`, and are now also mirrored at the top of the JSON body as `x402Version`/`accepts` (for clients that only read the body). Sign against `accepts[0].amount` (header or body, they're identical), not `price.amount`: `price.amount` is the per-source cost plus margin **before** the flat $0.001 transaction fee, while `accepts[0].amount` is the exact USDC (6-decimal) amount you will be charged — for the default 10 sources that is `263500`, i.e. $0.2635. Payment authorizations are valid for `maxTimeoutSeconds: 300`.

A `GET` to the same URL returns a 402 quoting the default price (10 sources) — useful for discovery.

Expand Down
4 changes: 3 additions & 1 deletion docs/api-reference/text-to-speech.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ Differences from the ElevenLabs models:

### The 402 challenge

An unpaid POST returns `402` with the x402 requirement in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers and an informational body:
An unpaid POST returns `402` with the x402 requirement in the `X-Payment-Required` / `PAYMENT-REQUIRED` / `WWW-Authenticate` headers, mirrored at the top of the body as `x402Version`/`accepts`; the rest of the body is informational:

```json
{
"x402Version": 2,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "53500", "asset": "0x8335…", "payTo": "0x…", "maxTimeoutSeconds": 300 }],
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": { "amount": "0.053500", "currency": "USD" },
Expand Down
Loading
Loading