Skip to content
Dagon Inference

Dagon Inference / Pay for an LLM API with USDC

Pay for an LLM API with USDC

Published · Last updated

With Dagon Inference you create an API key with one request, fund it with USDC through hosted checkout from $5 to $1,000, and pay only for the tokens each request uses. Creating a key asks for no email or password, and there is no subscription.

How does paying in USDC work?

  1. Create a key: curl -X POST https://inference.dagon.so/v1/keys returns a gk_ key. No email, no password.
  2. Ask for a checkout link: POST https://inference.dagon.so/v1/credits/checkout with the amount in dollars.
  3. Pay USDC on the hosted page. You can also pay from another chain that Circle CCTP supports.
  4. The credit posts when the payment settles, and requests start drawing it down.

You can do all of this in the console instead.

Two cards, one slot
insert card
A prepaid key (gk_) is funded with USDC through hosted Zoneless checkout, $5 to $1,000 per top-up. A private lease (lk_) comes from zkAPI for a deposit the gateway never learns: it carries only a spend limit ($1.00, $2.00, $3.00, $4.50, $6.00, at most $10.00) and a short life, 300 s by default. Past the slot the gateway meters both keys the same way.

Can an agent pay per request without a key?

Yes, with x402 (versions 1 and 2, exact scheme, USDC on Solana mainnet). Send the request with no key and the API answers 402 with the payment requirements: the usual error object plus x402Version and accepts in the body, and the v2 requirements in the PAYMENT-REQUIRED header. The amount is the request's maximum cost, at least $0.5, paid to our treasury 9rMdbu4KdLWH2nPXbzhm9HTKaibGZ2ckakQbW1wPh6KK in USDC. Your client signs a USDC TransferChecked to the treasury, with the gateway's fee payer from extra.feePayer so you need no SOL, and repeats the request with it in X-PAYMENT or PAYMENT-SIGNATURE. The gateway checks the transaction, screens the paying wallet against the OFAC sanctions list, settles it on chain and answers the request.

The paid response returns the transaction in X-PAYMENT-RESPONSE and a new gk_ key in x-dagon-key holding what the request did not spend; use that key for the next requests. A key that runs low gets a 402 asking for a top-up of at least $1, credited to that key. Each transaction is credited once.

import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactSvmScheme, toClientSvmSigner } from "@x402/svm";
import { createKeyPairSignerFromBytes } from "@solana/kit";

const wallet = await createKeyPairSignerFromBytes(secretKey); // a wallet holding USDC
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", client: new ExactSvmScheme(toClientSvmSigner(wallet)) }],
});
const res = await pay("https://inference.dagon.so/v1/chat/completions", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ model: "abliterated-model-large-flash", messages: [{ role: "user", content: "Hi" }], max_tokens: 200 }),
});
const key = res.headers.get("x-dagon-key"); // keep it: it holds the rest

The v1 clients x402-fetch and x402-axios work too, with createSigner("solana", privateKey). The x402 guide has the full 402 response, a Python client, the limits and every error code.

What does it cost?

The token price of the provider that serves the request plus our 10% markup, billed in whole millionths of a dollar. There are no seats and no minimum spend beyond the $5 top up. Full numbers are on the pricing page.

Can I give separate keys to agents or teammates?

Yes. Sign in to the console with a passkey, add USDC to your account balance, then mint a key for each agent, script or teammate and fund each with a set amount. You can add funds, take unspent money back, or delete a key and the balance returns to you. A lost or leaked key is replaced in seconds. Keys under one account can be linked to each other, and balances are prepaid credits held by the service.

How do you know you were charged correctly?

Every request gets an Ed25519 signed receipt with the token counts, price version, markup and charge. The console verifies it in your browser, and anyone can redo the arithmetic against the gateway's public key at /v1/identity.

Is there a way to pay without linking a wallet to usage?

Yes: private leases from a zkAPI server. The prepaid key path links the paying wallet to the key it funds.

Common questions

Which chains can I pay from?

Hosted checkout takes USDC. It also offers paying from other EVM chains that Circle CCTP V2 supports.

How do I know the checkout page is genuine?

Our checkout runs only at https://pay.dagon.so, and you reach it only from a top up you start. Before you approve, check that the amount matches the one you chose and that the destination matches, in full, the treasury or contract address listed on official domains and payment addresses. We never ask you to pay by direct message, ad or a link we did not generate.

What if I lose my key?

It is lost, with its balance. We store only a hash, so we cannot show a key again and cannot verify who owns one; we do not recover, transfer or refund a lost key. Save it in a password manager the moment it is created. Keys minted under a passkey account can be replaced.

Do credits expire?

From 2026-11-27, we may expire credits that remain unused 365 days after the top up that bought them, except where the law requires otherwise. Keep your key secret; it is a bearer credential and is shown once.

What is the largest top up?

$1,000 per top up, and the smallest is $5.

Can I pay with x402?

Yes, on the inference endpoints, in USDC on Solana mainnet. The 402 response lists the amount, the treasury and the fee payer; the paid response returns a prepaid key holding the unspent rest. Standard x402 clients such as @x402/fetch with @x402/svm handle it.

Create a key in a minute.

Get a key