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.
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 }.
curl -s https://api.glianalabs.com/v1/images/generations \
-H 'content-type: application/json' \
-d '{"model":"seedream-4.5","prompt":"a red apple on a table"}'
# 402 → pay the challenge (mppx / x402) → retry → { data: [{ url }] }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.
curl -s https://api.glianalabs.com/v1/chat/completions \
-H 'content-type: application/json' \
-d '{"model":"grok-4.3","messages":[{"role":"user","content":"Summarize x402 in one sentence."}],"max_tokens":256}'
# 402 → pay (mppx / x402) → retry → OpenAI chat-completion body + usage"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.
curl -s https://api.glianalabs.com/v1/tools/scrape \
-H 'content-type: application/json' \
-d '{"url":"https://example.com"}' # 402 → pay → { markdown }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.
curl -s 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"}'
# 402 → pay → { image: {url}, video: {url}, url } · override { 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.
# brainrot IMAGE ($0.20) — the brainrot-character model
curl -s https://api.glianalabs.com/v1/images/generations \
-d '{"model":"brainrot-character"}'
# brainrot VIDEO + audio (~$1.05) — both a model AND a recipe, no prompt needed
curl -s https://api.glianalabs.com/v1/video/generations \
-d '{"model":"brainrot-video"}'
curl -s https://api.glianalabs.com/v1/recipes/brainrot-video \
-d '{"motionPrompt":"it dances and bounces"}'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 both MPP (/v1/infer)
and x402 (/x402/<model>).
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:
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.