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.
- RupiahTop up a prepaid balance in rupiah (QRIS, virtual account or e-wallet) on the dashboard, then call with an API key. Each call deducts the same model price — no gas, no per-call fee.
- Card(coming soon) International cards.
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.
AI primitives
6Search, embeddings, moderation and extraction an agent composes with.
Image rendering
8Turn text or a URL into a social card, thumbnail or meme.
Web data
3Read a page and get back data instead of HTML.
Market data
10Token prices, pairs, TVL, gas and FX — live rates.
Company filings
10What US public companies reported to the SEC. Reported, never traded.
Indonesian data
9Regions, ID numbers, tax IDs, QRIS and prayer times. Free.
Identity & faces
5Face detection, comparison and ID document reading.
OSINT & verification
6Vet a domain, email, phone or IP from open sources before you trust it.
Security checks
9Find leaked credentials, lookalike domains, missing headers and spoofed senders.
# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/tools/address-id \
-H "content-type: application/json" \
-d '{
"address": "Jl. Medan Merdeka Barat No. 12 RT 03/RW 05, Gambir, Gambir, Jakarta Pusat 10110"
}'
# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/tools/address-id \
-J '{"address": "Jl. Medan Merdeka Barat No. 12 RT 03/RW 05, Gambir, Gambir, Jakarta Pusat 10110"}'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 Code, Cursor,
Codex, Claude Desktop and any MCP client can browse models and generate directly. Tools: list_models, get_price, get_schema, generate, list_tools, tool, recipe.
Claude Code — one command installs the server and a skill that tells Claude when to use it:
/plugin install gliana-ai --marketplace Gliana-Labs/gliana-mcp
Cursor — add to Cursor in one click,
then replace gk_your_key. Codex and every other client take the same three lines:
[mcp_servers.gliana-ai]
command = "npx"
args = ["-y", "gliana-ai-mcp"]
env = { GLIANA_API_KEY = "gk_your_key", GLIANA_MAX_PER_CALL_USD = "1", GLIANA_MAX_PER_DAY_USD = "10" }{
"mcpServers": {
"gliana-ai": {
"command": "npx",
"args": ["-y", "gliana-ai-mcp"],
"env": {
"GLIANA_API_KEY": "gk_your_key",
"GLIANA_MAX_PER_CALL_USD": "1",
"GLIANA_MAX_PER_DAY_USD": "10"
}
}
}
}GLIANA_API_KEY is a prepaid key from the dashboard — no wallet,
nothing to sign. Prefer paying from your own wallet with no account? Use GLIANA_WALLET_KEY_FILE (Base / Tempo) or GLIANA_SOLANA_KEY_FILE instead; the key is read locally and never sent.
The two MAX variables are spending caps: every paid call is priced from the
gateway's own 402 quote before anything is paid, and refused, free, if it would pass either.
Prefer zero-install? A hosted server is live at mcp.glianalabs.com/mcp (Streamable HTTP) for browsing,
pricing, schemas and the free tools — no key.
From a Cloudflare Agent
The gateway speaks MPP, the payment protocol Cloudflare's Agents SDK documents for paying services, so an Agent calls GlianaAI with plain mppx — no
account, no API key, no adapter. maxAtomicAmount is the spending cap:
mppx refuses any call priced above it before signing anything (USDC units, so "200000" = $0.20).
import { Agent } from "agents";
import { Mppx, evm } from "mppx/client";
import { Assets } from "mppx/evm";
import { privateKeyToAccount } from "viem/accounts";
export class StudioAgent extends Agent<Env> {
async image(prompt: string) {
const mppx = Mppx.create({
methods: [
evm({
account: privateKeyToAccount(this.env.WALLET_KEY),
currencies: [Assets.base.USDC], // USDC on Base
maxAtomicAmount: "200000", // refuse any call over $0.20, before signing
}),
],
polyfill: false,
});
const res = await mppx.fetch("https://api.glianalabs.com/v1/infer", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ model: "nano-banana", prompt }),
});
if (!res.ok) throw new Error(`GlianaAI ${res.status}`);
return res.json(); // { model, costMicroUsd, output: { url } }
}
}Would rather not hold a wallet key in the Worker? Use a prepaid key from the dashboard and plain fetch — the call returns 200 directly, and the key carries its own daily cap:
const res = await fetch("https://api.glianalabs.com/v1/infer", {
method: "POST",
headers: {
"content-type": "application/json",
authorization: `Bearer ${this.env.GLIANA_API_KEY}`, // gk_…
},
body: JSON.stringify({ model: "nano-banana", prompt }),
});Needs mppx 0.15 or later; currencies is required on Base, since the
challenge names the token only by address. Tested end to end from a Cloudflare Agent against this API.
Every model and tool on this page works the same way: change the path and the body. GET /v1/price?model=… quotes a call for free first.