Maximize every token you spend on AI.
Call dozens of frontier models through one OpenAI- and Anthropic-compatible API, billed per million tokens in USDC and routed to the best-priced healthy provider. No monthly plan, no commitment — pay for what you use, at a fraction of official pricing.
Reach upstreams that normally live behind a monthly plan
One API, two protocols, a marketplace behind it
InferHub is an OpenAI- and Anthropic-compatible API with a marketplace behind it. Call any model with one key; route to capacity that fits your budget.
Get started in one command
Coding agents first: run the helper, paste your key, pick models. Or point your OpenAI / Anthropic SDK at InferHub — same request shape, same streaming, one key for both.
# Point Claude Code, Codex, OpenCode, Hermes, OpenClaw, Cline at InferHub
npx @inferhub/helper
# Interactive wizard:
# 1. paste API key → validated via GET /v1/models
# 2. select agents
# 3. search & pick models
# 4. confirm → configs written
// OpenAI SDK → any upstream
import OpenAI from "openai";
const client = new OpenAI({
apiKey: proces...KEY,
baseURL: "https://api.inferhub.dev/v1",
});
const res = await client.chat.completions.create({
model: "claude/sonnet-4-5",
messages: [{ role: "user", content: "Explain PKCE." }],
});
// Anthropic SDK → Claude upstream
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: proces...KEY,
baseURL: "https://api.inferhub.dev",
});
const res = await client.messages.create({
model: "claude/opus-4-8",
max_tokens: 1024,
messages: [{ role: "user", content: "Write a haiku." }],
});
// Consumer combo → first provider with capacity
const res = await client.chat.completions.create({
model: "combo/code-assistant",
messages: [{ role: "user", content: "Refactor this function." }],
stream: true,
});
Full walkthrough in docs. Package: @inferhub/helper.
Models reachable without buying the plan
Per-Mtoken pricing in USDC — guaranteed at or below 50% of official rates. Publishers set their ask; the platform enforces the cap.
Free models are listed as free/<provider>/<model> and settle at $0, but only accounts with balance > 0 can call them. Free capacity is best-effort and can be unavailable or stopped at any time.
| Model | Input / Mtok | Output / Mtok |
|---|
Two paths, same platform
Put your model capacity to work
Your idle model capacity has headroom. Connect one of the curated upstreams once, set your per-Mtoken price, and earn USDC from capacity you'd otherwise waste. We track real upstream usage so you never get cut off unexpectedly.
Pay-per-use for consumers, payout for publishers
Consumers optionally attach a bid (x-max-input-price / x-max-output-price) and we route to a provider that meets it. Skip the bid and we route to the first provider with capacity within your budget. No subscription tier required on either side.