Quickstart

Call your first model

Pay-per-call AI. No signup, no API key. You pay per request from your own account via MPP — in USDC on Tempo, Base, or Solana.

01
Install

Add the client and a wallet signer.

02
Fund a payer wallet

One-time. Your balance lives in your own account, not ours.

03
Call any model

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

Model page →
# 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",
    "image": <string>,
    "prompt": <string>
  }'

# 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", "image": "<string>", "prompt": "<string>"}'

Fill the inputs shown as <type> — usually just a prompt (and an image URL for image-to-video). 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

GET /v1/models
GET /v1/schema?model=
GET /v1/price?model=
POST /v1/media
POST /v1/infer
POST /x402/<model>
GET /openapi.json

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.

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 -> image

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