Models & Units
FluxA AgentMarket routes LLM calls to many models (Claude, GPT, Gemini, DeepSeek, GLM, Kimi, Qwen and more) behind one OpenAI-compatible endpoint. There are no provider accounts to open: every call is paid from one prepaid Units balance on your AgentMarket account.
- Base URL:
https://router.fluxapay.xyz/llm/v1 - Wire formats: OpenAI Chat Completions (
/chat/completions) and Anthropic Messages (/messages) - Auth:
Authorization: Bearer <fxa_live_ API key>orAuthorization: Bearer <Agent VC>. See API Keys & Auth - Billing: per token, in Units. 1 Unit = $0.00001: 1 USDC or 1 Monetize Credit buys 100,000 Units
Quick example
curl https://router.fluxapay.xyz/llm/v1/chat/completions \
-H "Authorization: Bearer fxa_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-5",
"messages": [{ "role": "user", "content": "Hello" }]
}'Any OpenAI SDK works by setting the base URL:
from openai import OpenAI
client = OpenAI(base_url="https://router.fluxapay.xyz/llm/v1", api_key="fxa_live_...")
resp = client.chat.completions.create(
model="anthropic/claude-opus-5",
messages=[{"role": "user", "content": "Hello"}],
)No API key? An agent can authenticate with a short-lived Agent VC minted from its wallet identity instead:
VC=$(fluxa-wallet agent-vc --audience fluxa-wallet-service \
--challenge wallet-user-info-lookup --ttl 300 | jq -r .data.vc)
curl https://router.fluxapay.xyz/llm/v1/chat/completions \
-H "Authorization: Bearer $VC" -H "Content-Type: application/json" \
-d '{"model":"z-ai/glm-5.3","messages":[{"role":"user","content":"hi"}]}'Discover models
GET https://router.fluxapay.xyz/llm/v1/models
OpenAI-standard model list. No authentication. Use it to fill a model picker or as a health check.
{
"object": "list",
"data": [
{ "id": "x-ai/grok-4.6", "object": "model", "created": 1787074829, "owned_by": "aihubmix" },
{ "id": "anthropic/claude-opus-5", "object": "model", "created": 1787074829, "owned_by": "aihubmix" }
]
}A model offered by several providers is listed once. owned_by is the first provider that offers it.
GET https://router.fluxapay.xyz/llm/{provider}/v1/models lists one provider's models. An unknown provider returns 404 with code: "provider_not_found".
Models with prices
GET https://agentmarket.fluxapay.xyz/api/discover?type=model returns each (provider, model) offering with its price:
{
"models": [
{
"provider": "aihubmix",
"id": "anthropic/claude-opus-5",
"displayName": "Claude Opus 5",
"categories": ["text", "vision", "thinking"],
"inputUnitsPer1M": 500000,
"outputUnitsPer1M": 2500000,
"interfaces": ["chat", "messages"],
"source": "fluxa",
"urls": { "merchantGuide": "https://agentmarket.fluxapay.xyz/marketplace/models/aihubmix/skills.md" }
}
]
}| Field | Description |
|---|---|
provider | The provider that serves this offering. Use it to pin a provider (see Routing) |
id | Pass as model in the request body |
inputUnitsPer1M / outputUnitsPer1M | Price in Units per 1M tokens. 500000 Units = $5 |
interfaces | chat = /chat/completions, messages = Anthropic /messages |
urls.merchantGuide | Agent-readable guide for that provider |
Use search or query to filter, for example ?type=model&query=aihubmix or ?type=model&search=claude. See Discovery.
For full rate cards, including cached-input and long-context tiers, use GET https://agentmarket.fluxapay.xyz/api/llm/models?vendor={provider}. Read the rates_units_per_mtok object of each model (input_tokens, output_tokens, cache_hit, and tiers[] with an above_tokens threshold). GET https://agentmarket.fluxapay.xyz/api/llm/vendors lists providers with slug, name, description, modelCount and priceRange.
CLI: fluxa-wallet market search --models ["<provider>"], fluxa-wallet market search --vendors.
Endpoints
| Method | URL | Format |
|---|---|---|
POST | https://router.fluxapay.xyz/llm/v1/chat/completions | OpenAI Chat Completions. Provider chosen for you |
POST | https://router.fluxapay.xyz/llm/v1/messages | Anthropic Messages. Claude models only |
POST | https://router.fluxapay.xyz/llm/{provider}/v1/chat/completions | OpenAI Chat Completions on one provider |
POST | https://router.fluxapay.xyz/llm/{provider}/v1/messages | Anthropic Messages on one provider |
The request and response bodies are the standard OpenAI or Anthropic ones. "stream": true is supported where the model supports streaming.
On /messages, Anthropic clients may send the credential as x-api-key: <fxa_live_ key or Agent VC> instead of Authorization. Errors on /messages come back in Anthropic's error shape with the same status codes.
Routing
On /llm/v1/... the model field decides where the call goes. When several providers offer the model, the one with the lowest input price is used. To pin a provider, either put it in the path (/llm/{provider}/v1/...) or add a provider field to the body:
{ "model": "anthropic/claude-opus-5", "provider": "aihubmix", "messages": [ ... ] }The provider field is removed before the request is forwarded.
Response headers
| Header | Description |
|---|---|
X-LLM-Cost-Credits | What this call cost, in Units |
X-LLM-Balance | Your Units balance after this call |
X-LLM-Cost-Clipped | true if the charge was capped below the computed cost |
X-FluxA-Request-Id | Request ID. Quote it when you contact support |
Errors
Errors on /chat/completions are JSON with an error field, and often a message:
{ "error": "rate_limited", "message": "The model provider is rate limiting requests. Please retry after a short delay." }| Status | error | Meaning |
|---|---|---|
400 | (message) | Missing or invalid JSON body, missing model, or a model that is not available |
400 | (message), code: "interface_not_supported" | The model is not served on this format. interfaces lists the formats it is served on |
400 | invalid_request | The model rejected the request (for example, the input is too long). message explains why |
401 | (message) | Missing, invalid or revoked credential, or an expired Agent VC. Mint a fresh VC and retry |
402 | settle_required | Your Units balance is negative. See Negative balance |
403 | spend_cap_exceeded | This API key reached its spend cap. Includes cap_credits and spent_credits in Units |
403 | Account suspended | The account cannot make calls |
404 | (message) | Unknown provider, or no provider serves this model |
429 | rate_limited | Too many requests. Honor Retry-After if present |
502 | (message) | The model could not be reached. Not charged |
503 | upstream_unavailable | The model is temporarily unavailable. Not charged. Retry later |
Failed calls are not charged.
Units balance
Units are one balance per account, spendable on any model at any provider. They do not expire.
GET https://router.fluxapay.xyz/llm/wallet/balances
Auth: API key or Agent VC.
{
"balance": {
"balance": 482150,
"balanceUsd": 4.8215,
"lifetimeSpent": 17850,
"burn7dPerDay": 2550
}
}| Field | Description |
|---|---|
balance | Units left. Negative means you owe Units (see below) |
balanceUsd | The same in USD |
lifetimeSpent | Units spent on model calls, all time |
burn7dPerDay | Average Units spent per day over the last 7 days |
balance is null if the account has never held Units.
CLI: fluxa-wallet market model remainingUsage
GET https://router.fluxapay.xyz/llm/wallet/ledger
Top-ups and spending, newest first. Auth: API key or Agent VC.
| Param | Default | Description |
|---|---|---|
kind | all | all, purchases (Units added) or spend (Units used) |
limit | 20 | 1 to 100 |
offset | 0 | Pagination offset |
{
"kind": "all",
"total": 42,
"offset": 0,
"limit": 20,
"entries": [
{ "ts": "2026-10-27T09:12:44Z", "type": "meter", "amount": -1250, "balanceAfter": 482150 },
{ "ts": "2026-10-26T18:01:02Z", "type": "topup", "amount": 500000, "balanceAfter": 483400 }
]
}type | Meaning |
|---|---|
topup | Units added by a purchase |
meter | A model call |
| any other value | An account adjustment or refund. Use the sign of amount |
Entries may carry extra fields. Rely only on the fields above.
CLI: fluxa-wallet market model usageHistory
Negative balance
A call that costs more than your remaining balance still completes, and your balance can go below zero. Once the amount owed grows past a small limit, model calls return 402 with error: "settle_required" and x402 accepts that either clear the exact amount owed or buy a bundle. Pay one of them with FluxA Agent Wallet and resend the call with X-Payment, or simply top up and retry.
Top up Units
Units are sold in fixed bundles. Every bundle grants Units at the same rate: 1 USD = 100,000 Units.
| Bundle | Price | Units |
|---|---|---|
mini | $1 | 100,000 |
starter | $5 | 500,000 |
mid | $10 | 1,000,000 |
pro | $25 | 2,500,000 |
There are three ways to pay:
| Rail | Pays with | Best for |
|---|---|---|
| x402 (agent) | Monetize Credits or USDC on Base, from the agent's wallet under a spending mandate | Agents. No browser step after the mandate is approved |
| Payment link | Monetize Credits, through a FluxA Wallet checkout page | A human approves in the browser |
| Card | Visa/Mastercard via the wallet's linked card | Humans without USDC or credits |
Never top up without the user's explicit approval of the bundle and the rail.
Agent top-up with x402
The CLI does the whole flow:
fluxa-wallet market model topup --bundle starter --credit # pay with Monetize Credits (default)
fluxa-wallet market model topup --bundle starter --usdc # pay with USDC on Base
fluxa-wallet market model topup --bundle starter --mandate mand_xxx # reuse a signed mandateWithout --mandate, the CLI creates a spending mandate and prints an approval link for the human. Full agent guide: agentmarket.fluxapay.xyz/marketplace/models/agent-topup.md.
The underlying API has two steps.
POST https://router.fluxapay.xyz/llm/topup/initiate
Auth: API key or Agent VC.
{ "packageSlug": "starter" }Answers 402 on success, with the x402 challenge for the order:
{
"x402Version": 1,
"error": "X-PAYMENT header is required",
"accepts": [
{ "scheme": "exact", "network": "fluxa-monetize-credits", "...": "..." },
{ "scheme": "exact", "network": "base", "...": "..." }
],
"orderId": "4f6c...",
"resource": "https://router.fluxapay.xyz/llm/topup/finalize/4f6c...",
"costCredits": 5,
"creditsToGrant": 500000
}costCredits is the price in Monetize Credits (= USD). creditsToGrant is the Units you get. The base accept is present when USDC top-ups are offered.
| Status | Meaning |
|---|---|
400 | Body is not JSON, or no packageSlug |
401 / 503 | Credential problem / sign-in service temporarily unavailable |
404 | Unknown bundle |
POST {resource} (finalize)
Pay the challenge with fluxa-wallet x402-v3 --mandate <id> --payload <402 body>, then POST the returned token to the resource URL. No bearer token is needed here.
curl -X POST "https://router.fluxapay.xyz/llm/topup/finalize/4f6c..." -H "X-Payment: <xPaymentB64>"{ "success": true, "replayed": false, "creditsAdded": 500000, "balance": 982150 }Finalizing a completed order again returns the same result with replayed: true.
| Status | Meaning |
|---|---|
400 | Missing X-Payment |
402 | Payment rejected or not completed. Not charged |
404 | Unknown order |
409 | The order failed. Create a new top-up |
Payment link
POST https://router.fluxapay.xyz/llm/topup/paylink
Creates a FluxA Wallet checkout link for a bundle. Nothing is charged until a human opens the link and approves it. Auth: API key or Agent VC.
{ "packageSlug": "starter" }{
"orderId": "8a1d...",
"creditsToGrant": 500000,
"amount": 5,
"currency": "FLUXA_MONETIZE_CREDITS",
"checkoutUrl": "https://...",
"statusUrl": "https://router.fluxapay.xyz/llm/topup/order/8a1d..."
}| Status | Meaning |
|---|---|
400 | Body is not JSON, or no packageSlug |
404 | Unknown bundle |
502 | The payment link could not be created. Try again |
Give checkoutUrl to the human, then poll statusUrl.
GET https://router.fluxapay.xyz/llm/topup/order/{orderId}
Auth: the same account that created the order.
{ "status": "settled", "creditsToGrant": 500000, "balance": 982150 }status | Meaning |
|---|---|
pending | Processing. Waiting for payment |
settled | Completed. The Units are on your balance |
failed | Failed. Create a new order |
Treat any other value as processing. Poll every few seconds; do not loop forever.
Card
An agent can pay with the human's linked card, through FluxA Agent Wallet, without ever handling a card number. The agent creates an order with POST https://router.fluxapay.xyz/pay/createOrder/topup/{bundle}, the human approves a card spending limit once, the wallet pays, and the agent polls the order's statusUrl until status is settled. Follow the published step-by-step guide: agentmarket.fluxapay.xyz/marketplace/models/topup.md.
Card orders also appear as scheme: "card" entries in a settle_required 402.
Humans can also top up on the website at agentmarket.fluxapay.xyz/marketplace/models.
