Looking for plans and prices? See pricing →
publik API for builders
publik API is the model access built into apps on publik. Your users need no key to paste. A new install starts at $0.00; linking it to a publik account gives $0.05 of free use, once, and their own key still works. It speaks the OpenAI and Anthropic APIs at one base URL, so the same key works from your scripts.
Chat is priced at publik’s published price for each tier. That price sits above the model’s cost, and you get half the difference on your app’s calls. Audio, embeddings and images pass through at the provider’s price. Plans for your users are on the pricing page.
Ask for a tier, not a vendor slug. When the model behind a tier changes, your code does not. Every name under “Served by” and “Also answers to” is an alias for its tier; nothing is passed through raw.
publik-fast
Quick answers, cleanup, classification. The cheapest tier.
publik-balanced
The default. publik-default is a synonym.
publik-smart
The strongest tier. Needs a computer linked to a publik account.
Point any OpenAI- or Anthropic-compatible client at https://publikhq.com/api/v1. Pass your key as Authorization: Bearer or x-api-key. Keys look like pk_live_…, and apps on your computer have one already. Make one for your scripts on your Wallet page.
Each metered call returns x-publik-* headers with:
An empty balance returns a 402 with one link to fix it. An unlinked computer gets a claim link; a linked one gets an add-credit link.
Every app on publik opens with Sign in with publik. The module adds it, and counts signed-in users. publik holds a fellow's listing without it, and counts no users for any app without it.
Paste this into Claude Code, Codex or any coding agent, in your app’s repo. The agent shows you a plan and changes nothing until you say yes. You approve it once in this browser, so run it in an interactive session. It lists the app and adds the publik module: Sign in with publik when the app starts, usage counting, and publik API next to your users’ own-key option when the app uses AI. Then it runs the built app once to prove it. No key passes through the chat.
Set up my app on publik. Fetch publikhq.com/skills/setup.md with curl and follow it step by step.Add the publik module to my app (publik slug: <your-app-slug>): Sign in with publik, usage counting and publik API. Fetch https://publikhq.com/skills/api.md with curl and follow it step by step.List my app on publik. Fetch https://publikhq.com/skills/publish.md with curl and follow it step by step.Reference modules (TypeScript, Python, Swift, Rust) and the notes agents read are linked from /llms.txt.
Requests go through publik’s servers to a shared model account. publik does not train on them. It stores no request bodies beyond a 24-hour idempotency fingerprint. The model provider’s own abuse-monitoring retention applies. Every app that uses publik API also lets you use your own key instead.
Keep requests under 4 MB, base64-encoded images included. Resize screenshots first: about 1568 px on the long side as a JPEG is plenty. Audio for transcription has the same limit; split longer recordings client-side.