Mint an API key.
Deposit $HERO once and get a key loaded with that $HERO. Your agent runs 500+ models through one gateway with the key, no private key, no gas per call. The key can never spend more than you loaded onto it.
No wallet needed. Dollars become prepaid credit on a fresh key, spent as $HERO at the live rate. A key holds up to $200 at a time and reloads as often as you like.
All sales final. Card credit is prepaid usage, spent as you go. No refunds and no chargebacks: a disputed payment removes the unspent credit and closes card funding for that key. Buy small first if you are unsure.
Connect a wallet to see the keys tied to it.
Stored on this device. Turn on sync to encrypt them to your wallet and have them on every device.
Zero-dependency JS/TS client: chat, streaming, image/video/audio generation, a Vercel AI SDK provider, and a drop-in <HeroRunChat/> React widget, all paid from your key.
npm install hero-run-aiimport { createHeroRun } from "hero-run-ai";
const hero = createHeroRun({ apiKey: process.env.HERO_RUN_KEY });
// text, with the routing + cost receipt
const { text, hero: meta } = await hero.chat([{ role: "user", content: "hi" }]);
console.log(text, meta.charged_hero, meta.resolved_model);
// images and video from the same key
const img = await hero.generate({ kind: "image", prompt: "a brass foundry ring" });
const clip = await hero.generate({ kind: "video", prompt: "molten metal, slow pan" });
// drop-in React chat widget
// import { HeroRunChat } from "hero-run-ai/react";
// <HeroRunChat apiKey={key} model="auto" />Hero Run speaks the OpenAI API. Point any OpenAI SDK or agent framework at our base URL, use model auto for the multi-gateway router, and it pays from your key.
from openai import OpenAI
hero = OpenAI(base_url="https://herorunai.com/v1", api_key="hr_live_...")
r = hero.chat.completions.create(
model="auto", # router picks a right-sized model, one flat price
messages=[{"role": "user", "content": "Summarize this changelog in 3 bullets:\n" + open("CHANGELOG.md").read()}],
)
print(r.choices[0].message.content)
print(r.x_hero) # {'routed_tier': 'mid', 'resolved_model': ..., 'gateway': ..., 'charged_hero': ...}Base URL https://herorunai.com/v1 · works with the OpenAI SDK, Vercel AI SDK, LangChain, CrewAI, and more. Streaming supported.
Paste this into Claude Code, Codex, opencode, Cursor, or any coding agent with a terminal, and it installs the Hero Run MCP server for you.
Set up the Hero Run MCP server for me. Download https://herorunai.com/hero-run-mcp.mjs, run `npm install viem` next to it, then ask me for my Hero Run API key (I can mint one at https://herorunai.com/keys). Register it as a stdio MCP server named "hero-run" that runs `node <abs path>/hero-run-mcp.mjs` with env HERO_RUN_KEY=<key>, using whatever method my agent uses: for Claude Code run `claude mcp add hero-run -e HERO_RUN_KEY=<key> -- node <abs path>/hero-run-mcp.mjs`; for opencode, merge this into ~/.config/opencode/opencode.json (create it if missing): {"mcp":{"hero-run":{"type":"local","command":["node","<abs path>/hero-run-mcp.mjs"],"enabled":true,"environment":{"HERO_RUN_KEY":"<key>"}}}}; for Grok Build add the equivalent stdio MCP server to ~/.grok/config.toml (and, to also run Grok on Hero Run models, add a [model.hero-run] with base_url="https://herorunai.com/v1", env_key="HERO_RUN_KEY"); for Codex, Cursor, or others add the equivalent stdio server entry to my MCP config. Then list the hero-run tools to confirm it works. Reference: https://herorunai.com/llms.txt
Machine-readable setup: /llms.txt · server: /hero-run-mcp.mjs
Run 500+ models from a Telegram chat, paid from your own $HERO key. Your token and key stay on your machine, and you pay only for your own usage.
- Create a bot with @BotFather and copy its token.
- Mint a HERO_RUN_KEY above (the $HERO loaded on your key).
- Deploy the bot (Docker shown; Fly.io and Railway also work):
docker build -f examples/telegram-bot/Dockerfile -t hero-run-bot . && docker run -d --restart=always -e TELEGRAM_BOT_TOKEN=<your-botfather-token> -e HERO_RUN_KEY=<your hr_live key> --name hero-run-bot hero-run-botCommands: /models, /ask, /image, /treasury, /balance. Full guide and one-command Fly/Railway deploy in the telegram-bot example.
The deposit loads onto the key you pasted above, raising its spending limit.