Build on NOTE

One OpenAI-compatible API for hundreds of models, paid with the NOTE your deposit's interest mints. Use it from your code, from your agent over MCP, or let an agent pay its own way from its own wallet.

Preview The API opens when Prism launches. Until then this page is the specification it is built to; names and limits can change before it opens.

Quick start

  1. Open the app and connect your wallet.
  2. Have NOTE: deposit into a vault to earn it, or mint it with USDC.
  3. Under Developers, create a key. Copy it; it is shown once.
  4. Point any OpenAI SDK at Prism's base URL with your key. The base URL is published at launch.
from openai import OpenAI

client = OpenAI(base_url=PRISM_BASE_URL, api_key=PRISM_KEY)

reply = client.chat.completions.create(
    model="anthropic/claude-haiku-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

Anything that speaks the OpenAI chat format works the same way: LangChain, the Vercel AI SDK, LlamaIndex, and tools that take a custom base URL.

API keys

Create keys in the app under Developers. Give each app or environment its own key, so you can see what each one spends and turn one off without touching the others.

SettingWhat it does
NameA label for you, like "Discord bot" or "staging". It shows in the activity log.
Spending limitOptional. Once the key has spent this much, it is turned away with key_limit_reached until you raise or remove the limit.
Allowed modelsOptional. A list of model ids the key may use. Anything else returns model_not_allowed.
PauseTurns the key off at once without deleting it.
DeleteRevokes the key for good.

Each wallet can have up to 20 keys. Keys are stored only as hashes, so a key cannot be shown again. Keys can call models but cannot manage the account or move NOTE. Keep them on your server, never in a browser bundle.

Models

Use any model id from the list endpoint. It returns every model OpenRouter serves, from OpenAI, Anthropic, Google, DeepSeek, xAI, Meta, Mistral and more, with their prices per token.

curl $PRISM_BASE_URL/models

Auto routing

Set model to auto and the router picks the cheapest model that can handle each request: quick questions go to a fast model, code to a stronger one, hard reasoning to the top tier.

Auto routing is for wallets holding at least 1,000 $PRISM. The response says what was picked in the x-prism-model and x-prism-tier headers. Send x-route-floor: mid or top to start from a stronger tier.

Routing only

Already have your own OpenAI, Anthropic or OpenRouter account? Keep it. Send Prism the request you are about to make and it names the model to use; you call that model yourself, with your own key. Prism never sees your provider key or the reply. Each decision is a flat $0.0002, whatever the request's size, and no $PRISM is needed. Overview and savings calculator.

const pick = await fetch(PRISM_BASE_URL + "/route", {
  method: "POST",
  headers: { Authorization: "Bearer " + PRISM_ROUTE_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ messages, models: { fast: "gpt-5.4-mini", mid: "gpt-5.5", top: "gpt-5.5-pro" } }),
}).then(r => r.json());

const reply = await openai.chat.completions.create({ messages, model: pick.model });   // your own key

Request

FieldMeaning
messagesRequired. The chat you are about to send. Include tools or images if the real request has them; they affect the pick.
modelsOptional. Your own model for each tier: fast, mid, top. Without it, you get the router’s picks as OpenRouter ids.
floorOptional. mid or top, to never go below that tier.

Response

FieldMeaning
modelThe model to call.
tier, reasonsWhich tier was picked, and why (for example code, or long input).
fallbacksStronger models to try, in order, if the pick fails.

Requests

POST /chat/completions takes the standard OpenAI body. Streaming, tools, JSON mode and images pass straight through to the model.

HeaderMeaning
x-prism-modelThe model that answered.
x-prism-tierfast, mid or top, when Auto routing chose the model.
x-prism-costWhat the request took from your NOTE, in dollars.

Agents pay their way

An agent does not need to borrow your key. It can use its own Solana wallet to sign in, hold its own NOTE, and even fund itself.

Way to payHow it works
Its wallet as its loginThe agent signs a message with its wallet and gets its own key and account. Signing moves no funds.
NOTENOTE sent to the agent’s account pays for its requests.
Its own vaultThe agent deposits USDC or xStocks into a vault. The interest becomes NOTE for its account, so its AI keeps being paid for.
A key with a limitOr give it one of your keys with a spending limit.

Agents over MCP

Prism runs a remote MCP server, so Claude, Cursor and other agents can call any model with your NOTE: for a second opinion, to hand off to a cheaper model, or to reach one they do not have.

claude mcp add --transport http prism $PRISM_BASE_URL/mcp \
  --header "Authorization: Bearer $PRISM_KEY"
ToolWhat it does
ask_modelSends a prompt to a model and returns the reply, the model used and what it cost. Use auto for Auto routing.
list_modelsSearches models by name, with prices per million tokens.
get_balanceHow much NOTE the key can still spend.

Billing

Every request is paid from your NOTE. You are charged for the tokens the model actually used, at the provider's price plus a 5% service fee. Every charge shows in the app with tokens, cost, time and which key made it. Routing-only decisions cost a flat $0.0002 each ($0.20 per 1,000), since no model runs on Prism's side.

Errors

Errors use the OpenAI shape, {"error": {"message", "type", "code"}}, so existing SDK error handling keeps working.

StatusTypeWhat to do
401authentication_errorThe key is wrong or was deleted.
401key_disabledThe key is paused. Resume it in the app.
402insufficient_balanceOut of NOTE. Deposit, or mint more with USDC.
402key_limit_reachedThis key hit its spending limit. Raise or remove it.
403model_not_allowedThe key is not allowed to use that model.
403auto_routing_lockedAuto routing needs 1,000 $PRISM in the key’s wallet. Name a model instead.
429rate_limit_errorToo many requests. Back off and retry.
502upstream_errorThe model provider did not answer. Retry, or try another model. You are not charged.

Rate limits

Each wallet can make up to 120 requests a minute across all its keys. Each wallet keeps its 5 newest agent sign-ins.