______ __ ___ /_ __/__ / /_____ ___ / _ \___ ____ ___ / / / _ \/ '_/ -_) _ \ / ___/ _ `(_-<(_-< /_/ \___/_/\_\\__/_//_/ /_/ \_,_/___/___/ LLM inference for agents. No API key. Just pay and pass. ================================================================================ WHAT IS THIS? ================================================================================ Token Pass is a pay-per-use LLM gateway. It gives your AI agents access to frontier models (GPT-4.1, Claude, Gemini, Llama, DeepSeek, and more) without needing an API key for each provider. Instead of API keys, your agent pays per request using crypto — automatically. You fund a wallet once, point your agent at this URL, and it handles the rest. HOW IT WORKS (the short version): 1. Your agent sends a chat completion request to this server 2. The server says "that'll cost $0.002" (HTTP 402) 3. Your agent pays instantly via an off-chain voucher (no manual step) 4. The server forwards the request to the best provider and streams back 5. Done. Your agent got its answer. You got charged fractions of a cent. The payment is handled by a client library (mppx) that wraps fetch(). Your agent code looks almost identical to a normal OpenAI call — the only difference is using mppx.fetch() instead of fetch(). WHY USE THIS INSTEAD OF AN API KEY? - One endpoint, many models. GPT-4.1, Claude Sonnet, Gemini, Llama — all behind the same OpenAI-compatible API. - No key management. No signing up for 5 different provider accounts. - Pay-as-you-go. No monthly minimums, no rate limit tiers to manage. - Agent-native. Your agent can fund its own wallet and manage its own spend without you in the loop. HOW TO POINT YOUR AGENT AT TOKEN PASS: Base URL: https://tokenpass-virid.vercel.app Your agent needs two things: 1. A wallet (any EVM private key) 2. The mppx client library (npm install mppx viem) Then replace your OpenAI/Anthropic base URL with the one above and use mppx.fetch() instead of fetch(). See the Quick Start below for the code. If your agent's wallet is empty, use the bridge endpoint (POST /v1/bridge) to move tokens from any chain (Ethereum, Base, Arbitrum, etc.) to Tempo. The bridge is free — no chicken-and-egg problem. ================================================================================ ENDPOINTS ================================================================================ GET /v1/models List available models + per-token prices (free) POST /v1/chat/completions OpenAI-compatible chat completions (paid via MPP) POST /v1/bridge Bridge tokens to Tempo (free, rate limited) GET /health Health check ================================================================================ QUICK START (recommended for agents) ================================================================================ npm install mppx viem import { Mppx, tempo } from 'mppx/client' import { privateKeyToAccount } from 'viem/accounts' // Setup: private key + session deposit. Does everything automatically. const mppx = Mppx.create({ methods: [ tempo({ account: privateKeyToAccount('0xYOUR_PRIVATE_KEY'), autoSwap: true, // converts between pathUSD <-> USDC.e automatically deposit: '5', // prepay $5 into a payment channel (session mode) }), ], }) // Use mppx.fetch() — handles 402 payment automatically const res = await mppx.fetch('https://tokenpass-virid.vercel.app/v1/chat/completions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'openai/gpt-4.1-nano', messages: [{ role: 'user', content: 'Hello' }], }), }) const data = await res.json() console.log(data.choices[0].message.content) That's it. No API key, no Tempo CLI, no passkeys. The mppx client: 1. Detects the 402 challenge 2. Opens a payment channel with your deposit (one on-chain tx) 3. Every subsequent request is an instant off-chain voucher — no blockchain tx 4. autoSwap handles pathUSD/USDC.e conversion on Tempo's DEX ================================================================================ PAYMENT MODES & PRICING ================================================================================ This service supports two payment modes with different pricing tiers. Both are handled automatically by the mppx client based on your configuration. SESSION MODE (recommended — set deposit) - First request deposits tokens into an on-chain escrow (payment channel) - Subsequent requests sign off-chain vouchers — instant, no blockchain tx - Agent can make thousands of calls with zero on-chain latency after the first - Session tracks cumulative spend; unused deposit is reclaimable on close - Use this for agents making multiple requests PRICING: input tokens + 25% of max output tokens Sessions average out over many requests — most completions use far less than max_tokens. The deposit covers the variance. This makes session mode significantly cheaper per-request than charge mode. tempo({ account: privateKeyToAccount('0x...'), deposit: '5', // deposit $5 into the channel autoSwap: true, }) CHARGE MODE (no deposit — pay per request) - Every request is a separate on-chain TIP-20 transfer - Simpler but slower — each call waits for blockchain confirmation - Use this for one-off requests PRICING: input tokens + 100% of max output tokens (worst case) Since each charge is a one-time payment with no refunds, you pay for the full max_tokens allocation upfront. tempo({ account: privateKeyToAccount('0x...'), autoSwap: true, // no deposit = charge mode }) PRICING COMPARISON Example: openai/gpt-4.1-nano, 100 input tokens, max_tokens=4096 Charge mode: cost based on 100 input + 4096 output (worst case) Session mode: cost based on 100 input + 1024 output (25th percentile) Both modes include a 2x markup over base model prices. Minimum charge: $0.0001. Session mode is ~4x cheaper per request for typical completions. SESSION MANAGEMENT (advanced) For full control over the payment channel lifecycle: import { tempo } from 'mppx/client' const session = tempo.sessionManager({ account: privateKeyToAccount('0x...'), maxDeposit: '10', }) await session.open({ deposit: 5_000000n }) // open channel, deposit $5 const res = await session.fetch(url, opts) // pay via voucher console.log(session.cumulative) // total spent so far const receipt = await session.close() // settle + reclaim remainder ================================================================================ QUICK START — CLI (alternative) ================================================================================ If you prefer the Tempo CLI (uses a browser-based passkey wallet): # 1. Install + login (one-time, opens browser) curl -fsSL https://tempo.xyz/install | sh tempo wallet login # 2. Fund your wallet (opens browser) tempo wallet fund # 3. Make a request tempo request -X POST \ --json '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"Hello"}],"max_tokens":50}' \ https://tokenpass-virid.vercel.app/v1/chat/completions Note: The CLI uses a passkey wallet with spending keys. First request costs ~$0.63 for key provisioning. Ensure $1+ USDC.e balance before first request. ================================================================================ HOW MPP PAYMENT WORKS ================================================================================ 1. POST /v1/chat/completions with no credential -> HTTP 402 2. Response includes WWW-Authenticate header with TWO payment options: Payment method="tempo" intent="charge" amount= Payment method="tempo" intent="session" amount= The charge amount is higher (worst case); the session amount is lower (25th percentile estimate). The client picks based on its configuration. 3. Client pays (on-chain tx for charge, off-chain voucher for session) 4. Server verifies payment, forwards to the LLM 5. Response streams back mppx/client and the Tempo CLI handle this flow automatically. ================================================================================ FUNDING YOUR WALLET (PAY WITH ANY TOKEN) ================================================================================ Your wallet needs tokens on Tempo (chain ID 4217) to pay. If you hold tokens on another chain, bridge them using the Uniswap Trading API. No Uniswap API key needed. One call does everything. STEP 1: Get bridge transaction (single call) POST https://tokenpass-virid.vercel.app/v1/bridge { "swapper": "YOUR_WALLET_ADDRESS", "amount": "5", "chainId": 8453 } Required fields: swapper Your wallet address (receives tokens on Tempo) amount Amount in USD (e.g. "5" for $5 USDC) Optional fields: chainId Source chain (default: 8453 = Base) tokenIn Source token (default: USDC on that chain) slippageTolerance Slippage % (default: 0.5) Supported source chains: Ethereum (1), Base (8453), Arbitrum (42161), Optimism (10), Polygon (137), Unichain (130) Response: { "quote": { inputAmount, outputAmount, estimatedFillTimeMs, ... }, "transaction": { to, data, value, chainId, gasLimit }, "approvalNeeded": true/false, "approvalTransaction": { to, data, value, chainId } // if needed } STEP 2: Send approval tx (only if approvalNeeded is true) Sign and broadcast approvalTransaction on the source chain. STEP 3: Send the bridge transaction on the source chain Sign and broadcast the transaction from the response. Tokens arrive on Tempo in ~15 seconds. The bridge delivers pathUSD — autoSwap handles conversion to USDC.e automatically. IMPORTANT: Token types on Tempo Bridging delivers pathUSD (0x20C0000000000000000000000000000000000000). This service charges in USDC.e (0x20c000000000000000000000b9537d11c60e8b50). With autoSwap: true, the mppx client handles the conversion automatically. ================================================================================ FULL AGENT INTEGRATION EXAMPLE ================================================================================ import { Mppx, tempo } from 'mppx/client' import { privateKeyToAccount } from 'viem/accounts' // Setup once — session mode with $5 deposit const mppx = Mppx.create({ methods: [ tempo({ account: privateKeyToAccount(process.env.PRIVATE_KEY), autoSwap: true, deposit: '5', }), ], polyfill: false, // don't polyfill globalThis.fetch }) // Helper — all payment handled automatically async function chat(messages, model = 'openai/gpt-4.1-mini') { const res = await mppx.fetch('https://tokenpass-virid.vercel.app/v1/chat/completions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ model, messages, stream: false }), }) const data = await res.json() return data.choices[0].message.content } // First call opens the channel (one on-chain tx, ~2s) const a1 = await chat([{ role: 'user', content: 'What is 2+2?' }]) // Subsequent calls are instant off-chain vouchers const a2 = await chat([{ role: 'user', content: 'What is 3+3?' }]) const a3 = await chat([{ role: 'user', content: 'What is 4+4?' }]) ================================================================================ AVAILABLE MODELS ================================================================================ - anthropic/claude-sonnet-4 - anthropic/claude-haiku-4 - openai/gpt-4.1 - openai/gpt-4.1-mini - openai/gpt-4.1-nano - google/gemini-2.5-pro - google/gemini-2.5-flash - meta-llama/llama-4-maverick - meta-llama/llama-4-scout - deepseek/deepseek-chat-v3-0324 - deepseek/deepseek-r1 - mistralai/mistral-medium-3 - qwen/qwen3-235b-a22b All prices at GET /v1/models. Prices are per-token in USD. ================================================================================ REQUEST FORMAT ================================================================================ Standard OpenAI chat completion parameters: model (required) Must be from the model list above messages (required) Array of {role, content} objects stream Default true. Set false for non-streaming max_tokens Max output tokens (min 16 for most models) max_completion_tokens Alias for max_tokens temperature Sampling temperature top_p / top_k Sampling parameters stop Stop sequences tools / tool_choice Function calling response_format e.g. {"type": "json_object"} ================================================================================ TEMPO NETWORK REFERENCE ================================================================================ Chain ID: 4217 RPC: https://rpc.tempo.xyz Explorer: https://explorer.tempo.xyz Tokens on Tempo: USDC.e 0x20c000000000000000000000b9537d11c60e8b50 (payment token) pathUSD 0x20C0000000000000000000000000000000000000 (bridge output) Gas: No native gas token. Fees paid in the TIP-20 token being transferred. Tx format: Legacy only (type: 0). No EIP-1559. State creation: First tx from a new address costs ~250k gas (~$0.25). ================================================================================ TROUBLESHOOTING ================================================================================ "insufficient funds" Wallet doesn't have enough tokens on Tempo. Bridge more using POST /v1/bridge. "access key does not exist" (Tempo CLI only) First-time key provisioning (~$0.63). CLI retries automatically. "spending limit exceeded" (Tempo CLI only) Spending key not authorized for token. Does not apply to mppx/client. Session deposit exhausted If cumulative session spend exceeds the deposit, the next request will trigger a new deposit. Increase your initial deposit to avoid mid-session on-chain transactions. 402 after payment Payment tx may have reverted. Check balance on explorer.tempo.xyz. 502 from proxy Upstream LLM provider error. Check model name and max_tokens (min 16). ================================================================================ ERRORS ================================================================================ 400 Invalid model or missing parameters. Check /v1/models. 402 Payment required. mppx/client handles this automatically. 429 Rate limited (bridge endpoint only). Max 10 requests/minute per IP. 502 Upstream LLM provider error. --- Token Pass — LLM inference for agents, paid with any token. Powered by MPP (tempo.xyz)