Add the client and a wallet signer.
One-time. Your balance lives in your own account, not ours.
The 402 challenge is paid automatically and retried.
First paid call in 5 minutes
Driving an agent — Claude Code, Cursor, or your own? Hand it one URL and it can work the rest out. Everything here is free; only the call at the end costs anything.
One document: how the 402 handshake works, which rails settle, how to quote a price first.
Describe the job in plain words and get ranked endpoints back, with prices. Free, and it never runs a model.
The first response is a 402 carrying the exact price. Pay from your wallet, repeat the request, get the result.
# 1. hand your agent the guide
curl https://api.glianalabs.com/skill.md
# 2. ask which endpoint fits — free, no wallet needed
curl 'https://api.glianalabs.com/v1/consult?intent=transcribe%20a%20podcast'
# 3. call it. the first response is a 402 with the price; pay and retry
curl -X POST https://api.glianalabs.com/v1/infer \
-H 'content-type: application/json' \
-d '{"model":"nano-banana-2","prompt":"a red apple"}'Already on MCP? Install the server and your client picks all of this up automatically.
Or set it up by hand
The same thing, step by step, if you would rather wire it yourself.
1. Install
JavaScript / shell pay via mppx (Tempo); Python, Go, and Rust pay via the x402 SDKs (USDC on Base) — pick your tab in step 3.
npm i mppx viem # JS / shell (Tempo) pip install "x402[requests]" eth-account # Python (Base)
2. Fund a payer wallet
Your balance lives in your own account, not ours.
npx mppx account create # Tempo: prints your 0x address — fund it with USDC # or for the x402 route: any Base wallet holding USDC (MetaMask etc.)
3. Pick a model, copy the code
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/infer \
-H "content-type: application/json" \
-d '{
"model": "bytedance/seedance-2.0",
"prompt": "<your prompt>"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/infer \
-J '{"model": "bytedance/seedance-2.0", "prompt": "<your prompt>"}'Replace the <…> placeholders (and the example file URLs) — the body shows only what you must supply: usually a prompt, plus any image/video URL the model needs. The API fills every other parameter from the model’s schema (GET /v1/schema?model=). cURL and JavaScript auto-pay via mppx (Tempo); Python, Go, and Rust pay USDC on Base via the x402 SDKs.
Pricing depends on the rail
You always pay the model price; each rail adds its own cost on top so the published price lands with us.
- USDCTempo, Base, or Solana — you pay the exact model price; your wallet covers network gas directly. No flat fee.
- Card(coming soon) Stripe adds 2.9% + $0.30 per transaction, with a ~$0.50 minimum charge. A $0.75 video costs ~$1.08; anything under ~$0.19 hits the $0.50 minimum. Best for human/browser flows, not micro-calls.
High volume — payment channels
MPP's Tempo session intent streams off-chain vouchers per call and settles once —
sub-cent, sub-millisecond, no per-call fee. Every call on /v1/infer is a one-time charge today;
the session intent isn't offered yet. Doing serious volume? Get in touch and we'll turn it on for you.
Endpoints
Fair-use rate limit: ~120 requests/min per IP. Doing more than that? Contact us and we'll raise it for you.
File inputs (image-to-video, video-to-video, transcription)
take a public URL. Got a local file? POST it to /v1/media with its Content-Type (video/image/audio, ≤40 MB) — it returns { url }, which you pass
straight into the model's file field (e.g. video_uri). No payment, no key.
OpenAI-style endpoints
Prefer the OpenAI shape? Use a capability endpoint grouped by modality and pass the model in the body — same pay-per-call charge as /v1/infer, media returns { data: [{ url }] }, transcription returns { text }.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/images/generations \
-H "content-type: application/json" \
-d '{
"model": "seedream-4.5",
"prompt": "a red apple on a table"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/images/generations \
-J '{"model": "seedream-4.5", "prompt": "a red apple on a table"}'The per-model /x402/<model> paths still work too — pick whichever fits your client.
LLM chat (OpenAI-compatible)
Point your existing OpenAI client at us — swap the base URL, keep your SDK —
and chat with Claude Fable 5, Claude Opus 4.8, GPT-5.5 / 5.5 pro, Gemini 3.1 Pro, Grok 4.3, or MiniMax M3,
pay-per-call. Billing is a pre-charged ceiling: (estimated input tokens + your max_tokens) at the model's per-1M rates — set max_tokens to bound spend; the response returns real usage.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/chat/completions \
-H "content-type: application/json" \
-d '{
"model": "grok-4.5",
"messages": [{"role": "user", "content": "Summarize x402 in one sentence."}],
"max_tokens": 256
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/chat/completions \
-J '{"model": "grok-4.5", "messages": [{"role": "user", "content": "Summarize x402 in one sentence."}], "max_tokens": 256}'"OpenAI-compatible" means the request and response shapes — payment replaces the API key.
A vanilla OpenAI SDK with only the base URL swapped will get HTTP 402 Payment Required: that's the payment step, not a bug.
Wrap the SDK's fetch with a payment client (one line with mppx — see the
snippet on the homepage) and it pays the 402 and retries automatically.
Text models are listed in GET /v1/models (category text). stream: true streams incrementally (SSE, OpenAI chunk format); tools/tool_choice do OpenAI function calling (response returns tool_calls, send results back as role: "tool"); vision models take image_url content parts; top_p and temperature pass through where the provider supports them.
Utility tools
Beyond models — flat pay-per-call utilities agents reach for, same payment gate.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/tools/scrape \
-H "content-type: application/json" \
-d '{
"url": "https://example.com"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/tools/scrape \
-J '{"url": "https://example.com"}'Recipes
Multi-model pipelines in one paid call — chain models into a result a single endpoint can't make. One charge (the sum of each step); you get every step's output plus the final url. The image-first path is 3–8× cheaper than a native text-to-video model and gives better subject control.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/recipes/image-to-video \
-H "content-type: application/json" \
-d '{
"prompt": "an italian-brainrot cat-shark, 3d meme",
"motionPrompt": "it dances"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/recipes/image-to-video \
-J '{"prompt": "an italian-brainrot cat-shark, 3d meme", "motionPrompt": "it dances"}'Returns every step plus the final url — { image: {url}, video: {url}, url }.
Override the models per call with { imageModel, videoModel }.
Brainrot 🧠
A random Italian-brainrot creature as an image — the brainrot-character model (also at /v1/images/generations) — or a one-call video with audio via the recipe. Pass an optional reference_image to brainrot-ify your own picture.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/images/generations \
-H "content-type: application/json" \
-d '{
"model": "brainrot-character"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/images/generations \
-J '{"model": "brainrot-character"}'Agent discovery
GlianaAI is indexed on the major payment-protocol directories, so an agent can find and
pay our endpoints with no hand-configuration — over MPP (/v1/infer), x402 (/x402/<model>), Algorand (/a402/…)
and BNB Smart Chain (/b402/…).
The spec lives at /openapi.json.
Add the skills to any agent client:
npx agentcash add https://api.glianalabs.com
Every model also has a native x402 resource at /x402/<model> (USDC on Base or Solana). Pay it
with the x402 client — the same code pays /a402/… (Algorand) and /b402/… (BNB Smart Chain), which carry the utility
tools and recipes; only the chain scheme you register changes:
import { x402Client, wrapFetchWithPayment } from '@x402/fetch'
import { ExactEvmScheme } from '@x402/evm/exact/client'
import { privateKeyToAccount } from 'viem/accounts'
const client = new x402Client()
.register('eip155:8453', new ExactEvmScheme(privateKeyToAccount(process.env.WALLET_KEY)))
const fetchWithPay = wrapFetchWithPayment(fetch, client)
await fetchWithPay('https://api.glianalabs.com/x402/nano-banana-2', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ prompt: 'a red fox' }),
}) // 402 -> auto-paid in USDC on Base -> imageUse via MCP
GlianaAI ships a Model Context Protocol server, so Claude
Desktop, Cursor, and any MCP client can browse models and generate directly. Tools: list_models, get_price, get_schema, generate.
Add to your client config (paid generate runs locally — your wallet key never leaves your machine):
{
"mcpServers": {
"gliana-ai": {
"command": "npx",
"args": ["-y", "gliana-ai-mcp"],
"env": { "GLIANA_WALLET_KEY": "0xYOUR_KEY" }
}
}
}Rails: base (default) / tempo via GLIANA_WALLET_KEY, solana via GLIANA_SOLANA_KEY. Discovery tools work with no key.
Prefer zero-install? A hosted server is live at mcp.glianalabs.com/mcp (Streamable HTTP) for browsing,
pricing, and schemas — no key. Paid generate still runs in the
local npx server so your wallet key stays on your machine.