Quickstart
Pay-per-call AI. No signup, no API key — you pay per request from your own account via the Machine Payments Protocol (MPP). Crypto or card.
1. Install
npm i @gliana-ai/sdk
2. Fund a payer wallet (one-time)
Your "balance" lives in your own account, not ours.
npx mppx account create # prints your 0x address # fund that address with USDC on Tempo — that's your "balance"
3. Call any model
Payment is automatic — the 402 challenge is paid and retried for you.
import { GlianaAI } from '@gliana-ai/sdk'
const ai = new GlianaAI({ payerKey: process.env.GLIANA_PAYER_KEY })
const { output } = await ai.text('sea-lion-27b', 'Halo, apa kabar?')
console.log(output.text)Without the SDK (raw mppx)
import { Mppx, tempo } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'
const account = privateKeyToAccount(process.env.GLIANA_PAYER_KEY)
const mppx = Mppx.create({
methods: [tempo({ account, deposit: '10' })], // channel for high volume
polyfill: false,
})
const res = await mppx.fetch('https://api.glianalabs.com/v1/infer', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ model: 'sea-lion-27b', prompt: 'Halo' }),
})
console.log(await res.json())Pay by card instead
No crypto? The same endpoint offers a Stripe card rail in its 402 challenge — pay in the browser flow via Stripe Elements. Crypto is for backends; card is for browser/human flows.
Models & pricing
Live catalog + per-call prices (free, no payment):
curl https://api.glianalabs.com/v1/models
Endpoints
- GET /v1/models — catalog + prices
- GET /v1/price?model=&units= — quote a call
- POST /v1/infer — run a model (402 → pay → result)
High volume? Set deposit to open a payment channel —
off-chain vouchers per call, settle on close. Sub-cent, sub-ms.