DexL Agents

One API. Every AI. Pay per call.

Start here

curl -i -X POST https://agents.dexl.io/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"gemini-3.6-flash","messages":[{"role":"user","content":"Hello"}],"max_tokens":256}'

You get a 402 with the exact price. Sign the payment, resend, get the answer.

Reference

Models

Live catalogue with current pricing.

Playground

Send a real request, see the real quote.

Health

Liveness, network and payment address.

Payment health

Whether the facilitator is reachable and our network is supported.

OpenAPI

Machine-readable spec. Discovery at /.well-known/x402.json.

Source & docs

Full documentation in the repository.

Good to know

Price follows max_tokens

You are quoted for the ceiling you ask for, not for what the model ends up writing.

Minimum charge $0.001

Payments below roughly this will not settle, so quotes are floored there.

Typos are free

A bad body or an unknown model is refused before the payment step. The 402 body lists valid ids.

A 402 says why

A rejected payment returns a specific code — expired, already used, insufficient — plus the facilitator's own words in x402_error.

Rate limits

120 requests a minute per IP. Every response carries X-RateLimit-Remaining.

TypeScript SDK

npm install @dexl/agents viem

const dexl = new DexL({ wallet });
const { amountUsd } = await dexl.quote({ model, messages, maxTokens: 512 });
const res = await dexl.chat.completions.create({ model, messages, maxTokens: 512 });

quote() asks the price without paying. Errors arrive as a typed DexLError with a stable code and a retryable flag.