# CheapTokens.ai ## Purpose CheapTokens.ai sells discounted Venice.ai API credits to builders and autonomous agents. Buyers pay once, receive a real Venice.ai INFERENCE API key, and call Venice directly at the Venice OpenAI-compatible API base URL. CheapTokens is not a general LLM proxy. It is a commerce and account layer for discounted Venice-compatible inference access. ## Products - Same-Day Credits: a temporary Venice API key for work that will run before midnight UTC on the purchase date. Same-Day Credits use UTC time-decay pricing, with discounts starting around 30% early in the UTC day and increasing toward 90% near midnight. Capacity affects availability and maximum purchase size, not the price. - Prepaid API Key: one reusable Venice API key with prepaid balance and a selected daily credit reserve. New Prepaid API Keys start tomorrow UTC. The selected daily reserve must fit the unreserved capacity available for that UTC day and must be at least one-seventh of the reserve balance. The daily reserve is deducted from prepaid balance each UTC day while funded. Prepaid API Key pricing is a flat 40% discount on Venice credits. ## How it works - Agent-native purchases use USDC on Base via the x402 protocol. The recommended machine route is /api/checkout/options followed by /api/buy. - Browser users may use card checkout when available. Card checkout has a $5 minimum and pass-through Stripe processing fees. - Upon fulfillment, the buyer receives a Venice.ai INFERENCE API key with a credit usage limit. - The key works directly against Venice: https://api.venice.ai/api/v1 - CheapTokens status/account pages help buyers recover, inspect, reissue, or top up eligible keys. ## Core value proposition Discounted Venice API credits. Same Venice infrastructure, lower price, with explicit UTC expiry and capacity limits. ## OpenAI-compatible endpoint The API key you receive works with Venice.ai's OpenAI-compatible endpoint: Base URL: https://api.venice.ai/api/v1 Auth: Bearer token (your Venice API key) Format: OpenAI-compatible chat, image, audio, embedding, and related APIs supported by Venice ## Agent workflow Agents and programs can use CheapTokens headlessly: 1. GET /api/pricing — check current time-based discount and remaining supply 2. GET /api/supply — confirm credits are available (not sold out) 3. Optional: GET /api/checkout/options — discover payment routes; recommended route is x402-base-usdc 4. POST /api/buy with { usdPaid } — buy Same-Day Credits via x402 USDC on Base For Prepaid API Key: include { purchaseMode: "prepaid", dailyReservedUsd }. Optional reserveStart must be "tomorrow" if provided. 5. Receive veniceApiKey in response — use immediately 6. GET /api/status/{veniceKeyLast6} — monitor status, usage, balance, and expiry/runway 7. Use key with any OpenAI-compatible SDK by changing base_url to https://api.venice.ai/api/v1 ## Account and recovery The Account page is https://cheaptokens.ai/status Account lookup modes: - Email: card buyers use /status?tab=email and enter the Stripe receipt / Stripe Link checkout email. CheapTokens sends a private one-time account link. Typing an email does not reveal whether purchases exist. - API key: paste or enter a key suffix to inspect limited public status. - Wallet: wallet buyers connect/sign to list purchases, reveal full keys, reissue eligible keys, and top up supported Prepaid API Keys. Recovery/privacy rules: - Full API keys are bearer credentials and are not shown from a plain email lookup. - Card receipt and recovery links open the Account email tab with a one-time token. - Wallet reveal/reissue requires a wallet signature. - /recover still exists for old links and direct support flows, but the normal account surface is /status. ## Wallet-signed account APIs No account creation is required for wallet buyers. The wallet address is the identity. - POST /api/wallet/purchases — list purchases (requires wallet signature) - POST /api/wallet/reveal — reveal full API key (requires wallet signature + purchase ID) - POST /api/wallet/reissue — get a fresh key for remaining active credits (requires wallet signature) ## Card recovery APIs Card buyer recovery is email-link based and intentionally non-enumerating. - POST /api/stripe/recover — request a private recovery/account email - POST /api/stripe/recover/claim — claim a one-time recovery token from the emailed link ## Playground The browser Playground is https://cheaptokens.ai/playground It lets a buyer test a CheapTokens/Venice key against Venice chat, image, text-to-speech, video, and music APIs. The Video tab supports text, image, source-video, and reference-image model inputs. The Playground proxies requests server-side to Venice using the user-provided bearer key. Keys are stored only in browser session storage by default; local browser persistence happens only if the user chooses "Remember on this browser." Uploaded and generated media is temporary test data, not durable project storage. For image generation, the Playground keeps Safe mode on. The UI shows Safe mode checked and disabled, snippets show safe_mode: true, and the server always forwards safe_mode: true to Venice. ## Key pages - Home: https://cheaptokens.ai/ - Buy credits: https://cheaptokens.ai/buy - Account: https://cheaptokens.ai/status - Playground: https://cheaptokens.ai/playground - Model pricing: https://cheaptokens.ai/pricing - Documentation: https://cheaptokens.ai/docs - Getting started: https://cheaptokens.ai/docs/getting-started - OpenAI compatibility: https://cheaptokens.ai/docs/openai-compatible - Agent skills guide: https://cheaptokens.ai/docs/agents - Skill pack: https://github.com/0xatd/cheaptokens-skills - Raw CheapTokens skill: https://raw.githubusercontent.com/0xatd/cheaptokens-skills/main/skills/cheaptokens/SKILL.md - OpenAPI spec: https://cheaptokens.ai/openapi.json - llms.txt: https://cheaptokens.ai/llms.txt - ai.txt: https://cheaptokens.ai/ai.txt ## API endpoints (no auth) - GET /api/pricing — current time-based discount, credits per dollar, supply status - GET /api/supply — daily capacity, sold amount, remaining credits - GET /api/inventory — inventory status (total, sold, remaining, percent) - GET /api/status/{last6} — purchase status by Venice key suffix (last 6 chars) - GET /api/venice/pricing — live Venice.ai model pricing summary - GET /api/payments/health — payment system health check - GET /api/checkout/options — machine-readable route discovery; x402 is the agent default ## API endpoints (payments) - POST /api/buy — purchase credits (agent-native x402 USDC payment flow) - POST /api/rhino/deposit-order — create asynchronous Rhino payment address order for cross-chain stablecoins ## API endpoints (wallet-signed) - POST /api/wallet/purchases — list wallet's purchases - POST /api/wallet/reveal — reveal full API key for a purchase - POST /api/wallet/reissue — reissue key for active credits ## API endpoints (email recovery) - POST /api/stripe/recover — sends a private one-time recovery/account link when an email has fulfilled card purchases - POST /api/stripe/recover/claim — consumes the one-time token and returns recoverable card purchase keys ## API endpoints (playground) - GET /api/playground/models — list Venice models by type for the Playground - POST /api/playground/chat — proxy a user-key chat request to Venice - POST /api/playground/image — proxy a user-key image generation request to Venice with safe_mode forced true - POST /api/playground/speech — proxy a user-key text-to-speech request to Venice - POST /api/playground/video — quote, queue, and retrieve user-key video generation jobs from Venice - POST /api/playground/music — quote, queue, and retrieve user-key music generation jobs from Venice ## Headless buy — complete code example (Node.js) Requirements: npm install viem x402-fetch You need: a private key with USDC on Base network. ```javascript import { createWalletClient, http } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { base } from "viem/chains"; import { wrapFetchWithPayment } from "x402-fetch"; const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY); const wallet = createWalletClient({ account, chain: base, transport: http() }); const payFetch = wrapFetchWithPayment(fetch, wallet, BigInt(1_000_000)); // max $1.00 USDC // Step 1: Check pricing const pricing = await fetch("https://cheaptokens.ai/api/pricing").then(r => r.json()); console.log("Discount:", pricing.discountPercent, "credits per dollar:", pricing.creditsPerDollar); // Step 2: Buy credits ($1.00 worth) const res = await payFetch("https://cheaptokens.ai/api/buy", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ usdPaid: 1.00, purchaseMode: "spot" }), }); const { veniceApiKey } = await res.json(); // Step 3: Pick a live Venice text model const traits = await fetch("https://api.venice.ai/api/v1/models/traits?type=text", { headers: { Authorization: "Bearer " + veniceApiKey }, }).then(r => r.json()); const model = traits.data?.default || traits.data?.fastest; // Step 4: Use the key with OpenAI SDK import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.venice.ai/api/v1", apiKey: veniceApiKey }); const response = await client.chat.completions.create({ model, messages: [{ role: "user", content: "Hello from an autonomous agent" }], }); console.log(response.choices[0].message.content); ```