Skip to content

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> or Authorization: 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 ​

bash
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:

python
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:

bash
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.

json
{
  "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:

json
{
  "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" }
    }
  ]
}
FieldDescription
providerThe provider that serves this offering. Use it to pin a provider (see Routing)
idPass as model in the request body
inputUnitsPer1M / outputUnitsPer1MPrice in Units per 1M tokens. 500000 Units = $5
interfaceschat = /chat/completions, messages = Anthropic /messages
urls.merchantGuideAgent-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 ​

MethodURLFormat
POSThttps://router.fluxapay.xyz/llm/v1/chat/completionsOpenAI Chat Completions. Provider chosen for you
POSThttps://router.fluxapay.xyz/llm/v1/messagesAnthropic Messages. Claude models only
POSThttps://router.fluxapay.xyz/llm/{provider}/v1/chat/completionsOpenAI Chat Completions on one provider
POSThttps://router.fluxapay.xyz/llm/{provider}/v1/messagesAnthropic 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:

json
{ "model": "anthropic/claude-opus-5", "provider": "aihubmix", "messages": [ ... ] }

The provider field is removed before the request is forwarded.

Response headers ​

HeaderDescription
X-LLM-Cost-CreditsWhat this call cost, in Units
X-LLM-BalanceYour Units balance after this call
X-LLM-Cost-Clippedtrue if the charge was capped below the computed cost
X-FluxA-Request-IdRequest ID. Quote it when you contact support

Errors ​

Errors on /chat/completions are JSON with an error field, and often a message:

json
{ "error": "rate_limited", "message": "The model provider is rate limiting requests. Please retry after a short delay." }
StatuserrorMeaning
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
400invalid_requestThe 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
402settle_requiredYour Units balance is negative. See Negative balance
403spend_cap_exceededThis API key reached its spend cap. Includes cap_credits and spent_credits in Units
403Account suspendedThe account cannot make calls
404(message)Unknown provider, or no provider serves this model
429rate_limitedToo many requests. Honor Retry-After if present
502(message)The model could not be reached. Not charged
503upstream_unavailableThe 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.

json
{
  "balance": {
    "balance": 482150,
    "balanceUsd": 4.8215,
    "lifetimeSpent": 17850,
    "burn7dPerDay": 2550
  }
}
FieldDescription
balanceUnits left. Negative means you owe Units (see below)
balanceUsdThe same in USD
lifetimeSpentUnits spent on model calls, all time
burn7dPerDayAverage 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.

ParamDefaultDescription
kindallall, purchases (Units added) or spend (Units used)
limit201 to 100
offset0Pagination offset
json
{
  "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 }
  ]
}
typeMeaning
topupUnits added by a purchase
meterA model call
any other valueAn 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.

BundlePriceUnits
mini$1100,000
starter$5500,000
mid$101,000,000
pro$252,500,000

There are three ways to pay:

RailPays withBest for
x402 (agent)Monetize Credits or USDC on Base, from the agent's wallet under a spending mandateAgents. No browser step after the mandate is approved
Payment linkMonetize Credits, through a FluxA Wallet checkout pageA human approves in the browser
CardVisa/Mastercard via the wallet's linked cardHumans 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:

bash
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 mandate

Without --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.

json
{ "packageSlug": "starter" }

Answers 402 on success, with the x402 challenge for the order:

json
{
  "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.

StatusMeaning
400Body is not JSON, or no packageSlug
401 / 503Credential problem / sign-in service temporarily unavailable
404Unknown 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.

bash
curl -X POST "https://router.fluxapay.xyz/llm/topup/finalize/4f6c..." -H "X-Payment: <xPaymentB64>"
json
{ "success": true, "replayed": false, "creditsAdded": 500000, "balance": 982150 }

Finalizing a completed order again returns the same result with replayed: true.

StatusMeaning
400Missing X-Payment
402Payment rejected or not completed. Not charged
404Unknown order
409The order failed. Create a new top-up

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.

json
{ "packageSlug": "starter" }
json
{
  "orderId": "8a1d...",
  "creditsToGrant": 500000,
  "amount": 5,
  "currency": "FLUXA_MONETIZE_CREDITS",
  "checkoutUrl": "https://...",
  "statusUrl": "https://router.fluxapay.xyz/llm/topup/order/8a1d..."
}
StatusMeaning
400Body is not JSON, or no packageSlug
404Unknown bundle
502The 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.

json
{ "status": "settled", "creditsToGrant": 500000, "balance": 982150 }
statusMeaning
pendingProcessing. Waiting for payment
settledCompleted. The Units are on your balance
failedFailed. 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.

Released under the MIT License.