COMPUTE
. FINANCE

Documentation.

What is the CPI?

The Compute Price Index ("CPI") is a public benchmark that tracks the cost of AI inference across major providers. It produces a single equal-weighted reference price — the Standard Compute Unit ("SCU") — calculated from a basket of 21 models across 9 providers.

The Problem

LLM inference pricing is fragmented. Every provider quotes pricing differently — per token, per character, per request, per model. There is no standardized way to benchmark or compare the cost of AI computation across models and providers. You need a verifiable pricing reference you can audit independently.

The Solution

The CPI is an equal-weighted basket of 21 AI models across 9 providers that produces a single, verifiable unit of account: the Standard Compute Unit (SCU). The SCU represents the USD cost of a reference workload, 1,000 input tokens + 500 output tokens, taken as the geometric mean across the full basket.

Key Properties

  • Diversified — 21 models across 9 providers prevent any single provider from dominating the index.
  • Outlier-resistant — The geometric mean dampens any single model's impact, and the one-family-one-slot rule prevents version pile-up. No caps needed; the math does the work.
  • Versioned — The equal-weighted basket launches as v1.0 on June 18, 2026. Reconstitution-driven, published on-chain when basket composition or provider rate-card prices change. There is no fixed cadence.

Compute Finance ID

Your Compute Finance ID (CF ID) is your identity across all Compute Finance surfaces. Created on first sign-in via email or wallet, it ties together your profile, points balance, and referral code into a single record.

What CF ID stores

FieldDescription
cf_idPublic identifier — format: cf_usr_XXXXXXXXXXXX
emailUsed for notifications. Optional for wallet-only sign-in.
wallet_addressOn-chain address on Base. Created via account abstraction or connected externally.
display_nameUser-chosen name. Defaults to a truncated email or wallet address.
referral_codePermanent 8-character code — format: cf_ref_XXXXXXXX
points_balanceCurrent points total, denormalized from the points ledger

Sign-in flows

Two sign-in methods, both produce a CF ID:

  • Email — Enter your email, receive a 6-digit code, verify. A smart wallet is created on Base and associated with your email. No seed phrase required.
  • Wallet — Connect MetaMask, Coinbase Wallet, or any WalletConnect-compatible wallet. Sign a SIWE message. Your wallet address becomes your CF ID's primary identifier.

Both flows converge on the same CF ID record. You can add an email to a wallet-only account later from your settings.

Organizations

An organization lets several people work on one account — its owner's. The owner's balance pays for the members' requests, and the owner's API keys, spending limits, pools and history are shared with them. Every member keeps a personal account of their own alongside.

Personal and organization context

While you are signed in, your requests run in one context, remembered on your profile. Every account page shows the active context and your role in it in the account switcher at the top of the navigation — at the top of the page on a narrow screen — and switches from there in one step; Settings → Organizations switches too:

  • Personal — your own account — your balance, API keys, spending limits, pools and history.
  • Organization — the owner's account. The balance, API keys, spending limits, pools and history you see are the owner's; chat you send is paid from the owner's balance, and a key issued there belongs to the owner's account. What you may change there is set by your role.

Accepting an invitation makes that organization your active context. Creating an organization makes you its owner but does not switch to it. You can own at most 10 organizations. Over the API, POST /v1/orgs/context with an orgId switches and answers the context now active, orgId: null returns to the personal context, and POST /v1/invitations/accept switches into the organization it joins.

Some things keep the context they started in, whichever one is active later: a connected app acts in the context its grant was issued for, a Spark proposal is carried out in the context it was made in, and an API key always spends the account it was issued on.

Roles

Each member holds exactly one role — Owner, Admin or Member — and every role includes everything the role below it allows. The table is generated from the same declaration the API enforces. An action your role does not allow is refused with org_role_required; the one exception is member addresses, which a Member sees masked rather than being refused.

What the role allowsOwnerAdminMember
Send inference requests and chat, paid from the organization's balanceYesYesYes
See the organization's API keys, spending limits, pools, history and balanceYesYesYes
See who belongs to the organization and the role each member holdsYesYesYes
Create, edit, freeze and revoke the organization's API keysYesYesNo
Set the organization's spending limitsYesYesNo
Create, edit and delete the organization's pools, see and change who is in them, and accept, reject or revoke the endpoints suppliers offer themYesYesNo
Connect apps that make changes to the organization's accountYesYesNo
See every member's full email addressYesYesNo
See pending invitations; invite Members, resend or revoke their invitations, and remove MembersYesYesNo
Invite Admins, resend or revoke their invitations, and remove AdminsYesNoNo
Delete the organization once every other member has been removedYesNoNo

A role is never edited: to change someone's role, remove them and invite them again.

Who hands out which role

A role you can hand out is one you can take back. You invite someone to a role, resend or revoke an invitation to it, and remove a member who holds it only if your role could remove that member. The owner role is never handed out.

RoleInvites and removes
OwnerMember, Admin
AdminMember
MemberNobody

Invitations

  • An invitation is addressed to one email address. Only a signed-in account whose confirmed profile email is that address can accept it, so a forwarded link admits nobody else.
  • The link carries a one-time token, of which only a SHA-256 hash is stored. It expires 7 days after it is issued.
  • An organization holds at most 50 pending invitations. An expired invitation takes no slot, and inviting an address whose only invitation has expired replaces it.
  • Resending issues a new link and a new expiry, and the previous link stops working. Revoking withdraws an invitation for good; an accepted invitation cannot be revoked.
  • An invitation is pending, expired, revoked or accepted. While it is pending, its page shows the organization, the inviter, the role, what that role allows and the expiry, and the invitation email lists the same; in any other state the page shows only the state. Reopening an accepted link while signed in as the member it admitted leads back into the organization.

What always stays personal

These act on your own account whichever context is active, so none of them reaches the owner's account from inside an organization:

  • Funding — card top-ups, USDC swaps and stablecoin top-ups into your balance.
  • Withdrawal of $COMPUTE from your balance.
  • Saved cards.
  • Auto top-up.

Removing a member, leaving and deleting

  • Removal takes effect at once: the removed member's next request runs in their personal account, and every API key they issued on the owner's account is revoked in the same transaction.
  • An Admin or a Member can leave the organization, with the same effect on the keys they issued.
  • The owner can neither leave nor be removed. The owner can delete the organization instead, once every other member has been removed.
  • Deleting your profile deletes an organization you own alone; while an organization you own still has other members, the profile deletion is refused.

Spark assistant

Ask about your balance, spending, API keys and recent transactions. Spark uses the account information you are allowed to see and can take you to the relevant page.

Ask your first question

  1. Sign in and open Spark in the app, documentation or Oracle. Choose your personal account or organization in the app before asking.
  2. Review the cost and the information sent to the AI provider, then turn on Spark. You can turn it off in Settings at any time.
  3. Write a question and press Send. Name the key or period when it matters; ask a follow-up in the same conversation.

Try asking

  • Which models did I spend the most on this month?
  • When did I last use my API key “Development”?
  • What changed my balance recently?

Cost and notifications

Each answer is charged at model prices plus a 5% routing fee. Failed answers are free.

Each answer shows its charge in dollars. The panel also shows the conversation total and your available balance. Account spending limits apply. A useful answer that stops early can still be charged; an attempt with no useful answer is free.

Account notifications are free. They show when they were issued; their figures describe that moment. Dismiss a card to remove it. Closing Spark marks the notices you viewed as read; a new conversation does not clear notifications. Turning Spark off in Settings hides the assistant and its notifications in the app, documentation and Oracle.

Review a change before confirming

In Settings, enable “Allow Spark to make changes” separately from Spark itself. Ask for the change, review the confirmation card, then press Confirm. Your current account permissions still apply.

Spark can create, freeze or unfreeze an API key, set account spending limits, and turn auto top-up off or configure it with a saved card. Card auto top-up requires a saved card and an email address.

Auto top-up always belongs to your personal account, even while working in an organization. Funding, withdrawals and wallet approvals are steps you complete yourself.

After creating a key, use the card's link to reveal it once. Spark never receives the secret. If a confirmation expires, ask for the change again.

Account data and conversations

What Spark sends to the AI provider

  • Your question, the current page, the conversation and your app language
  • Organization name and your role in it
  • Balance, spending and limits
  • API keys — never the key itself
  • Card top-ups and auto top-up
  • Transaction history

Never full API keys, card details or other credentials.

Conversations are saved to your account and return when you turn Spark back on. Signing out deletes them.

Moving between pages keeps the conversation. “New conversation” starts fresh: earlier messages remain readable above the divider but are no longer used for answers, and the conversation total resets.

Each personal or organization context has its own conversation. Switching back restores that context's messages. Only a limited recent history is used for answers.

Open Spark settings

Points

Points track your activity with Compute Finance, including daily sign-ins, AI requests, contributions and referrals. Higher tiers depend on total points earned. Your points history is available when you are signed in.

Tiers

TierMin Points
Explorer0
Starter500
Builder2,000
Architect5,000
Titan15,000

How points are earned

Examples of recurring rewards and one-time achievements.

ChannelAmountTriggerFrequency
Signup bonus100 ptsNew CF ID profile created on first sign-inOnce per account
Referral (referrer)250 ptsValid referral confirmed when the invited user creates a profilePer successful referral
Referral (referred user)50 ptsNew profile created with a valid referral codeOnce per account
Daily check-in10 ptsFirst successful daily check-in for the UTC calendar dayOnce per day
Oracle interaction5 ptsAuthenticated claim through the points APIOnce per user per UTC calendar day

Streaks

Check in on consecutive UTC days to build a streak. Each milestone below awards a bonus once per streak, in addition to the daily reward. Missing a day restarts the streak at your next check-in.

Consecutive daysAmount
750 pts
1450 pts
30100 pts
60200 pts
90300 pts

Leaderboard

The leaderboard shows rank, display name, total points and tier. It does not expose wallet addresses or email addresses. The API supports category and result-limit filters.

Non-transferability

Points are an engagement score. They have no monetary value and cannot be transferred or converted into tokens, currency or API credits.

API endpoints

These endpoints read points data or request daily rewards. Personal endpoints require authentication; the leaderboard is public.

GET/v1/pointsYour earned and spent points, current balance, tier and check-in streak
GET/v1/points/historyYour paginated point awards and spending
GET/v1/points/leaderboardPublic ranking by points, with category and result-limit filters
POST/v1/points/daily-checkinRecord the daily check-in and award any reached streak milestone
POST/v1/points/claim-oracleClaim the daily Oracle reward

Points history response

GET /v1/points/history returns your point awards and spending. Each item in entries has the fields below.

FieldTypeDescription
idstringUnique entry identifier
userIdstringThe user whose points changed
categorystringCategory identifier for the point change
actionstringAction identifier, such as daily_login or first_csv_export
pointsnumberSigned integer: positive for awards, negative for points spent
metadataunknownEvent-specific JSON data; its structure depends on the action
createdAtstringWhen the entry was recorded, as an ISO 8601 timestamp

The response includes total, page, limit and totalPages for pagination. GET /v1/points returns totalEarned, totalBurned and currentBalance.

Referral Program

Every CF ID includes a unique referral code (8 characters). Share your link to invite new users — both sides earn points. The program uses first-touch attribution with a 30-day cookie window.

Referral rewards

EventPointsWho Earns
New user signs up with your code50 ptsNew user (welcome bonus)
You referred a new user250 ptsReferrer

Sharing your referral link

// Referral URL format
https://compute.finance/r?c=cf_ref_XXXXXXXX

Find your referral code in your Compute Finance ID settings. Share buttons are available for X, LinkedIn, Telegram, and copy-to-clipboard. The link uses a 30-day attribution cookie — referrals count when the referred user creates a CF ID within 30 days of clicking your link.

Attribution model

Referral attribution is first-touch with a 30-day window. The first referral link a user clicks is the one credited if they sign up within the window. Subsequent referral links from other users do not overwrite the original cookie.

How it works step by step:

  • A user visits https://compute.finance/r?c=cf_ref_XXXXXXXX
  • The server redirects to https://compute.finance and sets a cookie: cf_ref=cf_ref_XXXXXXXX with Max-Age=2592000 (30 days), SameSite=Lax, Secure
  • The click is recorded in the database with the referral code, timestamp, hashed IP address, and user agent
  • If the user signs up within 30 days — even if they navigate directly to https://compute.finance without the referral link — the cookie is read during CF ID creation and the referral relationship is stored
  • If the user has already clicked a different referral link, the first-touch cookie is preserved

Anti-gaming rules

The referral program enforces several rules to prevent farming and abuse. None of these rules surface error messages — invalid referrals are silently ignored to avoid leaking information about user accounts.

RuleImplementation
No self-referralIf the cf_ref cookie matches the signing-up user's own referral code, the referral is silently ignored
Email deduplicationOne CF ID per email — a user cannot create multiple accounts with the same email to farm referral points
IP rate limitingMaximum 10 CF ID creations per IP address per 24 hours, preventing mass account creation from a single source
Click rate limitingMaximum 100 clicks per referral code per hour. Clicks beyond the limit are not recorded.
Disposable email detectionOptional: reject signups from known disposable email domains (mailinator, guerrillamail, etc.)

Referral dashboard

Your CF ID profile includes a referral dashboard showing:

  • Total referral link clicks (all-time)
  • Total signups from your referral link
  • Conversion rate (signups ÷ clicks)
  • Total points earned from referrals
  • List of referred users (display name or truncated email, signup date, status: pending or confirmed)

Status transitions

A referral has two possible states. Points are awarded when the status transitions from pending to confirmed:

  • pending — The user clicked the referral link but has not yet completed signup
  • confirmed — The user has created a CF ID. Points are awarded to both sides within 60 seconds of confirmation.

Basket Composition

The CPI tracks 21 models from 9 providers. Every model family gets one slot, the latest version always, and each model is weighted equally. A family is a provider's distinct product line (e.g. openai.gpt, anthropic.claude); the latest released model in each family is its representative. On a new release the representative auto-rolls. The basket updates with a new version number when families are added, removed, or replaced.

alibaba.qwen-flash

Qwen3.8 Flash

alibaba.qwen-max

Qwen3.8-Max

alibaba.qwen-plus

Qwen3.7 Plus

anthropic.claude-fable

Claude Fable 5.2

anthropic.claude-haiku

Claude Haiku 5.5

anthropic.claude-opus

Claude Opus 5.5

anthropic.claude-sonnet

Claude Sonnet 5.5

deepseek.v-flash

V4.1 Flash

deepseek.v-pro

V4 Pro

google.gemini

Gemini 4 Argon

google.gemini-flash

Gemini 3.8 Flash

google.gemini-flash-lite

Gemini 3.5 Flash-Lite

minimax.m

MiniMax M3

minimax.m-flash

MiniMax M3.1 Flash

moonshot.kimi

Kimi K3.1 Pro

openai.gpt

GPT-6 Astra

openai.gpt-luna

GPT-6 Luna

openai.gpt-sol

GPT-6.1 Sol

openai.gpt-terra

GPT-6.1 Terra

xai.grok

Grok 4.7

xiaomi.mimo

MiMo V2.6 Pro

SCU Formula

The Standard Compute Unit is calculated in two steps. The reference workload is fixed at 1000 input + 500 output tokens, evaluated across all basket models.

The SCU is reconstitution-driven. It is published on-chain whenever the basket changes, either because a model is added, removed, or replaced, or because a provider updates a rate-card price. Both triggers produce a new on-chain version. There is no fixed cadence and no continuous off-chain feed.

Step 1 — Per-model cost

For each model in the basket, compute the cost of the reference workload using the provider's published per-token pricing. Prices are USD per 1M tokens.

cost_m = (input_price_m × 0.001) + (output_price_m × 0.0005)

Step 2 — Equal-Weight Geometric Mean

Take the geometric mean of all N model workload costs. Every model is weighted equally; there are no tiers, no caps, and no provider weights. Each model family holds one slot at its latest version, so a provider cannot inflate its representation by shipping extra SKUs.

SCU = (∏ cost_m)^(1/N) for all m in the index, N = 21

Live SCU: $0.002609 — the geometric mean of 21 equal-weighted model costs.

Every published revision permanently carries the methodology version that produced it (currently v1). Definitions and the changelog are served by the methodology endpoint; every oracle response carries the X-Methodology-Version header.

Anyone with access to provider pricing pages can independently reproduce this number.

Read the full methodology specification →

Governance

The model-family rule reduces governance to a minimum. One eligibility rule, one family rule, one emergency trigger. No weight committees, no tier reviews.

RuleSpecificationFrequency
Listing CriteriaPublic GA + first-party USD pricing + in-scope text model + seasoning + liveness. Applied identically to all.Continuous
Model Family RuleOne slot per family, latest GA version auto-wins. No governance needed.Auto
Edge-Case ReviewPublished, dated decision for family-vs-version edge cases. Stated reasoning.As Needed
ReconstitutionAdditions and removals applied by the criteria. Logged.Scheduled
Price UpdatesReflected automatically from first-party price cards. Daily scan.Daily
Emergency TriggerAny single model that moves price by more than the set threshold in 24 hours enters a short hold before the change is reflected.As Needed

Every basket change increments the revisionVersion counter. The full history is available via the GET /v1/oracle/reconstitutions endpoint. On-chain, the OracleRegistry contract records each published revision with its timestamp and metadata hash.

On-Chain Verification

All CPI pricing is recorded on-chain via the OracleRegistry contract on Base. You can independently verify prices without trusting the Compute Finance API.

Contract Address

NetworkBase (Chain ID 8453)
Contract0x1b91c0961928a14a2eD6c1985bC11aF1b302714D

Read Functions

FunctionDescription
version()Oracle implementation version — assert before deserializing tuples
decimals()Scale of scuUsd and baseline values (18)
lastRevisionVersion()Returns the highest confirmed revision number
getLatestRevision()Returns the latest revision header: revisionVersion, methodologyVersion, scuUsd, contentHash, metadataHash, publishedAt
getRevision(uint256 revisionVersion)Returns the same revision header tuple for a specific revisionVersion
getRevisionScuUsd(uint256 revisionVersion)Returns the SCU value in USD 18-dec for a specific revision
getBaseline()Returns the SCU value of the first revision (denominator of the inverse purchasing-power index)
getComputeIndex()Returns the latest (baseline / SCU) × 100
getRevisionAt(uint256 timestamp)Returns the revision version active at the given Unix-seconds timestamp
getComputeIndexAt(uint256 timestamp)Returns the atomic tuple (scuUsd, indexValue, publishedAt, methodologyVersion, revisionVersion) at the timestamp

Verification with ethers.js

JavaScript
import { ethers } from "ethers";

const ORACLE_REGISTRY = "0x1b91c0961928a14a2eD6c1985bC11aF1b302714D";
const ABI = [
  "function lastRevisionVersion() view returns (uint256)",
  "function getLatestRevision() view returns (tuple(uint256 revisionVersion, uint16 methodologyVersion, uint256 scuUsd, bytes32 contentHash, bytes32 metadataHash, uint64 publishedAt))",
  "function getBaseline() view returns (uint256)",
  "function getComputeIndex() view returns (uint256)"
];

const provider = new ethers.JsonRpcProvider("https://mainnet.base.org");
const oracle = new ethers.Contract(ORACLE_REGISTRY, ABI, provider);

// Read latest revision header
const latest = await oracle.getLatestRevision();
console.log("revisionVersion:", latest.revisionVersion.toString());
console.log("SCU (USD, 18-dec):", ethers.formatUnits(latest.scuUsd, 18));
console.log("metadataHash:", latest.metadataHash);

// Inverse purchasing-power index — (baseline / SCU) × 100
const computeIndex = await oracle.getComputeIndex();
console.log("Compute Index:", ethers.formatUnits(computeIndex, 18));

// Per-model prices live in the off-chain manifest fetched by metadataHash —
// resolve at /v1/oracle/manifest/{metadataHash} and verify with JCS+keccak256.

Verification via Basescan

You can also read the contract directly on Basescan. Since OracleRegistry is an upgradeable proxy, use the Read as Proxy tab so the implementation's functions are available:

  1. Go to Basescan → Contract → Read as Proxy
  2. Call getLatestRevision() — its first return value lists every registered model pricing key
  3. Read the on-chain revision header (scuUsd, methodologyVersion, contentHash, metadataHash, publishedAt) via getRevision(version). Per-model prices live in the off-chain manifest fetched by metadataHash.
  4. Prices are returned in $COMPUTE wei (18 decimals) per 1M tokens. Divide by 10^18 to get the $COMPUTE amount.

Verification via Sourcify

The same source is independently verified on Sourcify, a decentralized verification repository: View on Sourcify ↗

Public API

All oracle endpoints are public and require no authentication. Read access is free and unrestricted. Base URL: https://api.compute.finance

Endpoints

Every price the catalogue publishes carries a provenance mark — verified, inferred or promotional — on the number itself rather than on the model, so one model can be promotional at its flat rate and inferred on a cache component at the same time. A mark records whether an operator captured a vendor source for that number; it is set by hand and holds as of their last pass rather than as a live check, and it never changes what a request is billed.

GET/v1/oracle/scuCurrent SCU value, methodology version, and family-representative breakdown
GET/v1/oracle/modelsCatalog of basket models plus retired ex-members — `inBasket` flag and `retiredAtRevision`; retired models are priced from the live catalog. `usdPricePerMillion` and the cache / reasoning blocks are the vendors' list prices; `markedUpUsdPricePerMillion` is the same price with the routing markup, as billed
GET/v1/oracle/models/{key}Single catalog model (basket member or retired) by model id — the canonical `vendor/model` form, or the bare model name
GET/v1/oracle/models/{key}/price-historyPer-model input/output USD price time series — one entry per on-chain revision for basket members, one per catalog price change for every other model (per-revision, daily, or weekly granularity); Accept: text/csv returns a CSV attachment
GET/v1/oracle/catalogEvery tracked model (incl. catalog-only and pricing-only providers) with current price, integrated flag, index-member flag, the contextTiers ladder on models priced per context length, and a provenance mark on every number — verified (an operator recorded a vendor source for it), inferred (derived, no source recorded) or promotional (a discount that will end). Prices here are the vendors' own, without the routing markup.
GET/v1/oracle/models/{key}/price-at?date={iso8601}Per-model input/output USD price effective at the requested ISO-8601 timestamp; basket members resolve from the attested manifest, all other models from the live catalog — every response labels its source
GET/v1/oracle/basketFull basket composition: all models with equal weights, revision and methodology version
GET/v1/oracle/methodologyActive methodology version and full changelog
GET/v1/oracle/methodology/{version}Single methodology record (formula, family rule, reference workload, spec URL)
GET/v1/oracle/baselineFrozen SCU of the first confirmed revision — the denominator for the inverse computeIndex purchasing-power view
GET/v1/oracle/scu-at?date={iso8601}SCU value active at a given timestamp — step-function lookup of the latest confirmed revision with publishedAt ≤ date (highest revisionVersion on ties)
GET/v1/oracle/history?from={iso8601}&to={iso8601}&granularity={per-revision|daily|weekly}Historical SCU values, one entry per on-chain revision; granularity: per-revision, daily, or weekly; Accept: text/csv returns a CSV attachment
GET/v1/oracle/reconstitutionsNamed basket-change events with version, models, SCU delta
GET/v1/oracle/reconstitutions/exportExport full reconstitution history as a downloadable markdown file
GET/v1/oracle/revisions/{revision}Full OracleRevision record for a specific on-chain revision
GET/v1/oracle/latestLatest confirmed revision summary (version, timestamps, SCU, basket size)
GET/v1/oracle/healthLast revision timestamp, version count, on-chain sync status
GET/v1/oracle/contract-metadataLive OracleRegistry identity — chainId, proxy address, on-chain version(), and keccak256 of the deployed bytecode
GET/v1/oracle/statsPublic aggregate protocol statistics (TVL, users, volume)
GET/v1/oracle/activityLive activity feed of recent protocol events (paginated)
GET/v1/oracle/pricingPer-model pricing as billed — every figure already carries the routing markup, cache and reasoning components included; `/v1/oracle/models` publishes the same models at the vendors' list prices without it
GET/v1/oracle/resolve/{key}Resolve one model name to its canonical `vendor/model` id, prices and priceSource — percent-encode the separator (`openai%2Fgpt-5.5`) or pass the bare name. An unknown model is 200 with priceSource `off-basket` and null prices, never 404; an unknown vendor is 422
GET/v1/oracle/resolve?keys={csv}Resolve up to 100 comma-separated names in one call, input order preserved; every key is isolated, so a name the single form would refuse with 422 — an unknown vendor included — comes back as an `off-basket` entry instead of failing the batch
GET/v1/oracle/manifest/{metadataHash}Content-addressed manifest of a confirmed revision — verify `keccak256(JCS(manifest))` against the on-chain metadataHash

Code Examples

All endpoints are public. No authentication required.

Get Current SCU

curl https://api.compute.finance/v1/oracle/scu

List All Models

curl https://api.compute.finance/v1/oracle/models

Get Single Model

curl https://api.compute.finance/v1/oracle/models/claude-opus-5

Historical SCU (date range)

curl "https://api.compute.finance/v1/oracle/history?from=2026-05-18T00:00:00Z&to=2026-06-18T00:00:00Z&granularity=daily"

Response Schemas

GET /v1/oracle/scu

response
{
  "scuUsd": 0.003301944577548741,
  "computeIndex": 73.73384151088473,
  "referenceWorkload": { "inputTokens": 1000, "outputTokens": 500 },
  "methodologyVersion": 1,
  "breakdown": {
    "methodologyVersion": 1,
    "familyRepresentatives": [
      {
        "family": "openai.gpt",
        "modelKey": "gpt-5.5",
        "inputPriceUsdPerMillion": 5.0,
        "outputPriceUsdPerMillion": 30.0,
        "blendedCostUsd": 0.02
      }
    ]
  },
  "updatedAt": "2026-08-27T15:35:16.947Z"
}

GET /v1/oracle/models

response
{
  "models": [
    {
      "id": "openai/gpt-5.5",
      "displayName": "GPT-5.5",
      "provider": { "key": "openai", "name": "OpenAI" },
      "family": "openai.gpt",
      "weiPricePerMillion": { "input": 0.06781146800693592, "output": 0.4068688080416155 },
      "usdPricePerMillion": { "input": 5, "output": 30 },
      "markedUpWeiPricePerMillion": { "input": 0.07120204140728272, "output": 0.42721224844369626 },
      "markedUpUsdPricePerMillion": { "input": 5.25, "output": 31.5 },
      "releasedAt": "2026-04-23T00:00:00.000Z",
      "cache": {
        "cachedInput": { "usdPerMillion": 0.5, "ratioOfInput": 0.1, "source": "catalog", "sourceUrl": null, "provenance": "verified", "createdAt": "2026-08-26T15:16:10.984Z" },
        "cacheWrite5m": null,
        "cacheWrite1h": null,
        "read_multiplier": 0.1,
        "write_multiplier_5m": null,
        "write_multiplier_1h": null
      },
      "reasoning": {
        "reasoningOutput": { "usdPerMillion": 30, "ratioOfInput": 6, "source": "catalog", "sourceUrl": null, "provenance": "verified", "createdAt": "2026-08-26T15:16:10.984Z" }
      },
      "inBasket": true,
      "retiredAtRevision": null
    }
  ]
}

Error catalog

Every API response uses the envelope below on failure. Branch on error.code rather than HTTP status or error.message text — the code taxonomy is stable, message copy may change.

envelope
{
  "error": {
    "message": "The Bearer API key is missing, malformed, or not recognized.",
    "type": "invalid_request_error",
    "code": "invalid_api_key",
    "param": "authorization",                    // optional, set when the error binds to a field
    "details": { ... },                          // optional, code-specific structured payload
    "issues": [ ... ]                            // present when one or more fields fail validation
  }
}

type is derived from code with one exception, inside code: validation_failed — the 422 for a request the exchange refuses itself: a body that fails schema validation answers validation_error and lists every offending field in issues[], while a body that parsed and was then refused further in — a parameter the exchange knows the target provider refuses, a provider-capability mismatch, an input above the model's window — answers invalid_request_error and carries no issues[], so only type tells the two apart. A refusal the provider itself returned is the other 422, code: upstream_rejected, and always answers invalid_request_error.

CodeStatusTypeMeaningWhen it occurs
unauthorized401invalid_request_errorAuthentication is required to access this endpoint.The session cookie is missing or invalid, the Bearer token is absent, or the timestamp on a signed request is outside the 5-minute freshness window.
forbidden403forbiddenThe caller is authenticated but is not allowed to perform this action.The caller lacks the required role, a request was signed by an address different from the authenticated wallet, or an inference API key stopped reaching supply while its request was in flight: the key's account left its pool between authentication and routing, or the admission a supplier's model runs before each attempt found the key revoked or frozen or its account outside the pool. A key revoked or frozen before the request arrives answers `api_key_revoked` or `api_key_frozen` instead.
org_role_required403forbiddenThe caller's role in the active organization is below the one this action requires.The caller attempted an action their role in the active organization does not reach — managing keys, limits or pools and connecting apps that act on the account need ADMIN or OWNER; inviting a MEMBER, resending or revoking a MEMBER's invitation and removing a MEMBER need ADMIN or OWNER, while doing the same for an ADMIN needs OWNER, so an ADMIN hands out only the MEMBER role; deleting the organization needs OWNER; `details.minimumRole` names the role required and `details.actualRole` the one held.
invalid_signature401invalid_request_errorThe provided signature could not be verified.The EIP-191 signature is malformed, truncated, or does not recover to a valid signer.
signature_reused409invalid_request_errorThis signed request has already been submitted.The nonce for this signed request was consumed by an earlier submission.
invalid_api_key401invalid_request_errorThe Bearer API key is missing, malformed, or not recognized.The token is empty, does not use the `ct_live_` format, or matches no key the exchange issued. A key that exists but is revoked or frozen answers with its own code instead.
api_key_frozen403forbiddenThe API key is currently frozen and cannot be used for requests.The key was frozen from the API keys page or by support. Reactivate it from the API keys page, or contact support if it was frozen by an administrator.
api_key_revoked401invalid_request_errorThe API key has been revoked and can no longer be used.The key was revoked from the API keys page. Revocation is permanent — issue a new key to continue.
invalid_app_grant401invalid_request_errorThe Bearer app grant token is missing, malformed, or not recognized.The token is empty, does not use the `cfa_live_` format, or matches no grant the exchange issued. A grant that exists but is revoked or frozen answers with its own code instead.
app_grant_frozen403forbiddenThe app grant is currently frozen and cannot be used for requests.The grant was frozen from the connected apps section of Settings. Lift the freeze there; meanwhile the account's own session and every other grant keep working.
app_grant_revoked401invalid_request_errorThe app grant has been revoked and can no longer be used.The grant was revoked from the connected apps section of Settings. Revocation is permanent — the app has to be granted access again, which issues a new token.
model_restricted403forbiddenThe requested model is not in this key's allowed-models list.The key was restricted to a specific set of models; the request referenced a model outside that set.
bad_request400invalid_request_errorThe request is invalid in a way that does not match a more specific error code.A generic 400 for request-shape issues that no other code describes more precisely.
validation_failed422invalid_request_errorThe request failed validation. A schema failure lists every issue in `error.issues[]`; a single-field failure names that field in `error.param`.One or more fields — of the body, the query string, or the path — are missing, of the wrong type, or outside their allowed range.
upstream_rejected422invalid_request_errorThe upstream the request was routed to refused it as invalid.The request passed the exchange's own checks and reached an upstream — a vendor or a supplier's endpoint — which rejected it as invalid: a limit or parameter only that upstream enforces. `error.message` carries the upstream's own reason after the vendor slug or supplier handle that names it, cut to 200 characters, and `details.upstreamStatus` is the HTTP status the upstream answered with, or `null` when it reported the refusal without one — inside an answer it had begun with `200`, such as a Responses `response.failed`. Sending the same request again fails the same way; change the request. An upstream failure that is not a refusal of the request is retried on other capacity and never answers with this code.
method_not_allowed405invalid_request_errorThe endpoint exists but does not accept this HTTP method.A request used a method the route does not support; the `Allow` response header lists the accepted methods.
payload_too_large413invalid_request_errorThe request body is larger than the exchange accepts.The body exceeded the fixed body ceiling, which covers the largest context the exchange serves; it is refused before it is parsed, so no field-level detail is available.
not_found404not_foundThe requested resource does not exist.The identifier did not match any resource, or the URL does not match any endpoint.
already_exists409conflictA resource with the same unique identity already exists.A duplicate was detected during pre-check, or a concurrent write violated a unique constraint.
conflict409conflictThe request conflicts with the current state of the resource; read it again before retrying.The request names an identity that already exists — such as an email already linked to another account — or asks for an action the resource's current status does not allow — such as rejecting an offer that is no longer pending, or validating an endpoint while a validation of it is still running (`details.validationStartedAt`); `error.message` names which. A serializable transaction aborted by a concurrent write answers it too, and so does a supplier handle registration naming a standing terms version other than the current one — `error.param` is `termsVersion` and `details.currentTermsVersion` names the version to review and accept.
invitation_expired409conflictThe organization invitation is past its expiry and can no longer be accepted.The invitation link was opened after its expiry; a member who may hand out the invited role — ADMIN or OWNER for a MEMBER invitation, OWNER for an ADMIN one — has to send it again, which issues a new link and invalidates the old one.
invitation_revoked409conflictThe organization invitation was withdrawn before it was accepted.A member who may hand out the invited role — ADMIN or OWNER for a MEMBER invitation, OWNER for an ADMIN one — revoked the invitation; the link stays readable but can never be accepted.
invitation_already_accepted409conflictThe organization invitation has already been accepted.The invitation was accepted earlier, or two accepts raced and this one lost — an invitation admits exactly one member.
supplier_handle_taken409conflictThe supplier handle is already registered or reserved.Another supplier registered the handle first, or it equals a vendor slug (such as `openai` or `x-ai`) or a word the exchange reserves (such as `auto`), any of which would make a `handle/alias` model id ambiguous; `error.param` is `handle`. A handle is permanent once registered, so choose another.
supplier_handle_required409conflictThe caller has no supplier handle yet.Connecting an inference endpoint needs a supplier handle, which names every model the endpoint serves as `handle/alias`; register one with `POST /v1/supplier/handle` first.
offer_changed409conflictThe supplier's offer changed after the terms were read, or the terms name a price version that is not open.Terms sent with `PUT /v1/pools/{id}/offers/{offerId}/terms` named a price version other than the model's open one — one the supplier has replaced since the offer was read, or a mistyped id — or a declaration the supplier has retired since the offer was read; nothing was written. `error.param` is `models`, and `details.stale` lists each such model as `endpointModelId` with `openPriceVersionId`, the price version open for it (`null` once retired) — read the offer again and accept what it declares.
offer_pool_public422invalid_request_errorThe pool is public, and endpoints are shared only with private pools.A supplier shared an endpoint with a public pool; a public pool routes to the exchange's public supply, so it takes no supplier offers. `error.param` is `poolId`.
offer_unavailable422invalid_request_errorA model a supplier offers to the key's pool cannot serve this request.The request named a supplier's `handle/alias` model that cannot serve it, and no entry of the chain was sent upstream: `details.model` names it, `details.reason` says why — `awaiting_acceptance` (the pool owner has not accepted its current declaration), `price_above_ceiling` (the supplier's price at this request's input size is above the ceilings the pool owner accepted), `endpoint_disabled`, `endpoint_removed`, `model_retired`, `offer_closed` (the offer of its endpoint to the pool was revoked or rejected by the pool owner or withdrawn by the supplier), `validation_failed` (its endpoint has not passed validation for the requested operation) or `cooldown` (its endpoint failed the requested operation repeatedly and becomes available again on its own shortly) — and `details.actor` who has to act first for it to serve again, `pool_owner` or `supplier`: a closed offer also needs the pool owner to accept the supplier's new share, a retired model the owner to accept its new declaration, and a cooling-down endpoint is the supplier's to fix, while a removed endpoint never serves again and its `actor` is `null`. Inside `models[]` such an entry is skipped, also when it becomes unavailable while the request is being routed, and a request whose other entries were sent upstream and failed answers `all_routes_exhausted` instead. Nothing was charged.
operation_unsupported422invalid_request_errorThe request uses a feature the exchange does not offer on this endpoint.`POST /v1/responses` named a hosted tool — `web_search` (in Codex, set `web_search = "disabled"`), `file_search`, `code_interpreter`, `mcp` and the rest — or an input item or content part the exchange does not carry, such as `input_image`, `input_file` or a compaction item; or a model served over chat completions was sent server-executed `tool_search` or its history (use `execution: "client"` with a `parameters` schema and perform discovery in the client), a `tool_choice` naming a tool inside a `namespace`, or a tool whose chat name — `<namespace>__<name>` inside a namespace — does not match `^[a-zA-Z0-9_-]{1,64}$` or names another tool. `GET /v1/responses` answers it too, because the WebSocket transport is not offered: `426` on a WebSocket handshake, on which Codex falls back to HTTP, and `422` otherwise. `error.param` names what was refused — the field, with the item's index, or `transport`. Nothing was charged.
history_unsupported422invalid_request_errorThe request relies on response state the exchange does not keep.`POST /v1/responses` carried `previous_response_id`, `store: true` or an `item_reference` input item, or a stored response was retrieved or deleted. The exchange stores no responses: send the whole conversation — messages, function calls and their outputs — in `input` on every turn, with `store` left out or `false`. `error.param` names the field. Nothing was charged.
history_unavailable422invalid_request_errorThe conversation replays state only another backend can continue.`input` replayed a `reasoning` item the requested model cannot continue: the model is served over chat completions, which carries no reasoning state, or the item's encrypted reasoning was produced by another model's backend. Continue on the model that produced it, or start the conversation anew; the exchange never drops history to make a request fit. `error.param` names the item. Nothing was charged.
insufficient_balance402insufficient_quotaThe account's $COMPUTE balance is below the requested amount.Triggered when withdrawing more than the balance, or when an inference request would exceed the balance after billing.
spending_limit_reached429rate_limit_errorA spending cap has been reached.This request's reserved amount, added to what was already spent and to what requests still in flight hold, would exceed a daily or monthly cap on the key, or a daily, weekly or monthly cap on the account; `details.scope` names which carried it.
all_routes_exhausted502server_errorNo upstream capacity could serve the routed models.Every route the exchange tried for the requested models failed before any output — the capacity serving them was unavailable, rate-limited, cooling down or answered with an error. Nothing was charged; retry shortly.
deadline_exceeded504server_errorThe request ran out of time before any upstream produced output.Every request carries one time budget: an unstreamed request's lets each upstream attempt it may make run to its own timeout, up to the longest the exchange holds a request open, and a streamed request's is that longest hold. The budget ran out while the exchange was still routing — attempts were slow to answer, or cut at their timeouts — so no output reached the caller and nothing was charged. Retrying may succeed.
rate_limited429rate_limit_errorA rate or concurrency limit this request falls under was reached.The request hit a request-rate cap on this API route, or the pool's RPM/TPM cap — then `details.scope` is `pool` — or the concurrency, request-rate or token-rate limit of the supplier endpoint serving the named model — then `details.scope` is `endpoint`, `details.model` names the model, and inside `models[]` the next entry is tried instead. A route's request-rate cap names whose allowance was spent: `details.scope` is `caller` when the signed-in wallet or app grant spent its own, `address` when its network address spent the allowance every caller behind it shares, which is the only allowance an anonymous caller has. An endpoint validation is refused with it too: `details.scope` is `endpoint` when that endpoint was validated less than a minute after a validation of it that sent requests finished, `wallet` when the wallet already ran as many validations that sent requests as it may this minute or this hour. A route's request-rate cap and an endpoint validation both say how long to wait in `details.retryAfterSeconds` and the `Retry-After` header — for a request-rate cap, the longest wait among the windows that refused the request.
stream_interrupted500server_errorThe SSE stream aborted before completion.The upstream's stream dropped or ended without finishing after it had started delivering output, or the request ran out of its time budget while the answer was streaming. The exchange retries only before the first output, so this request is not retried. On a catalogue model an answer its vendor broke is not charged, and one the time budget cut is charged for the prompt and the output streamed before the cut; a supplier's model is charged by the usage its endpoint reported before the stream ended when that usage is valid, and not at all otherwise. This error is delivered inside the SSE body, not as an HTTP status.
endpoint_unreachable502server_errorAn inference endpoint could not be reached, or its response broke the exchange's transport rules.No response answers with this code. The exchange refused or could not complete a call to a supplier's endpoint: a request routed to it tries the next route and answers `all_routes_exhausted` when none serves, and an endpoint validation reports the reason as the failed check's `reason.code`, one of: `blocked_destination` (the URL is not a destination the exchange may call), `blocked_address` (the host resolves to a private or reserved network address), `dns_failure` (the host name did not resolve), `connect_failed` (the endpoint did not accept a connection), `tls` (the TLS handshake failed or the certificate is not valid for the host name), `timeout` (no response in time, or the response stalled partway — such as a stream that stops after partial output), `redirect` (the endpoint redirected — redirects are not followed), `protocol_error` (the response was not valid HTTP), `unrequested_stream` (the endpoint answered with an event stream to a request that did not ask for one), `connection_lost` (the connection closed mid-response) or `response_too_large` (the response exceeded the size the exchange accepts).
contract_error500server_errorAn on-chain call reverted or could not be confirmed.The transaction failed to broadcast, timed out waiting for a receipt, or the receipt reported failure. Where the layer that refused is known, `details.chainFailure.reason` names it: `contributor_frozen` (the escrow refuses this contributor until an operator lifts the freeze), `contract_rejected` (the contract refused for another reason), `relayer_unfunded` (the exchange could not pay for the transaction, so retrying will not help), `signer_unavailable` (the exchange's signing service refused or could not be reached, so retrying will not help), `chain_unavailable` (no verdict was reached, so retrying is meaningful) or `confirmation_pending` (the transaction was broadcast and its outcome is still unknown, so resubmitting risks a second charge and the exchange finishes it on its own). A withdrawal names its own outcome instead: `withdraw_not_sent` (nothing was charged, so retrying is safe), `withdraw_restoring` (the debit is being reversed), `withdraw_pending` (broadcast, outcome still unknown, so resubmitting risks paying out twice) or `withdraw_reverted` (the chain refused it, nothing left the escrow, and the balance returns within a few minutes).
internal_error500server_errorAn unexpected server-side failure occurred.A fallback for exceptions that no other error code describes; the failure is logged for investigation.
service_unavailable503server_errorA dependency, a setting or the capacity this request needs is unavailable.A dependency needed for this request is unreachable — security-critical paths intentionally reject rather than degrade — or no capacity serving the requested models was available to try, so nothing was sent upstream and nothing was charged; retry shortly, or name another model. An operator setting that cannot be read, such as the route list `auto` walks, answers it until an operator fixes it, so name a model rather than retry.

Inference API

An OpenAI- and Anthropic-compatible inference API. Point an official openai or @anthropic-ai/sdk client at Compute Finance by swapping the base URL and providing a ct_live_* key. Requests are billed from your $COMPUTE balance.

Base URL: https://api.compute.finance. Swagger UI: /v1/docs/inference · Get a key: https://compute.finance/dashboard/api-keys.

First request

Two things have to exist before any snippet works: an account and a balance on it. Signing in by email or by wallet creates the account — see Compute Finance ID. Its $COMPUTE balance is topped up at https://compute.finance/dashboard/ai-balance by card, by swapping USDC from a connected wallet, or in stablecoins (USDC, USDT or USDe) under Add funds → Stablecoins.

From there to an answer: issue a key at https://compute.finance/dashboard/api-keys, then run the cURL or the Python snippet with your key in place of ct_live_.... cURL needs nothing installed; the Python one is the official openai client with its base URL pointed here and everything else unchanged. The snippets name a model as vendor/model; how that name is formed, what auto does instead, and what the answer costs are under Integration contracts.

cURL
curl https://api.compute.finance/v1/chat/completions \
  -H "Authorization: Bearer ct_live_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.5","messages":[{"role":"user","content":"Hello"}]}'
Python — openai@2.45
from openai import OpenAI

client = OpenAI(
    base_url="https://api.compute.finance/v1",
    api_key="ct_live_...",
)

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

API keys

Keys are issued from the API keys page of your account. Issuance is free and never checks your balance, and every field on the form is optional — a key created with nothing filled in works. Its label and its spending caps stay editable afterwards.

The raw key is returned exactly once, at creation. Only its SHA-256 hash is stored, so nothing can show it again — copy it before you leave the page. From then on the list identifies each key by a short prefix: enough to tell two keys apart, useless as a credential. A lost key is replaced, not recovered — revoke it and issue another.

Freezing a key is reversible from the same page, as often as you like. Revoking is permanent — a revoked key can be neither restored nor edited, and it stays in the list only as a record. A state change binds from the next request onward; a request already streaming runs to its end. What each state returns is under Authentication.

A key can be held to a subset of the catalogue: name the models under allowedModels when you issue the key at https://compute.finance/dashboard/api-keys, and change the list later from the same page. The list replaces the previous one whole, and an empty list lifts the restriction. Each entry names a catalogue model by its vendor/model id or by the vendor's own SDK id and is stored as the vendor/model id; a spelling the catalogue does not hold is refused with 422 validation_failed naming it, and at most 50 entries survive once duplicate spellings collapse. A key bound to a private pool can also name, by its handle/alias id, a model the pool admits from a supplier's offer — the ids GET /v1/models lists under that key; any other handle/alias is refused the same way. The catalogue is a superset of GET /v1/models, so a model can be allowed before it is listed there. A request naming a model outside the list returns 403 model_restricted — it is never routed to a model the key may reach instead. Leave the list empty and the key reaches every model, including auto.

Balance is held on the account, not on the key: every key of an account spends the same $COMPUTE balance, and a key's daily and monthly caps only bound that key's share of it — exceeding one returns 429 spending_limit_reached, and a request in flight counts against them at its reserved amount until it settles. Because issuance never checks the balance, a new key on an unfunded account authenticates and then fails its first request with 402 insufficient_balance — top the account up at https://compute.finance/dashboard/ai-balance first.

Authentication

Every endpoint accepts Authorization: Bearer ct_live_*. POST /v1/messages, GET /v1/models, GET /v1/models/availability and GET /v1/inference/estimate also accept x-api-key: ct_live_* for @anthropic-ai/sdk compatibility.

Every request checks the key's state. A key marked active proceeds normally; a frozen key returns 403 api_key_frozen; a revoked key returns 401 api_key_revoked; anything unknown or malformed returns 401 invalid_api_key. If a key is restricted to a specific set of models and the request references another, the response is 403 model_restricted.

Endpoints

POST/v1/chat/completionsBearer ct_live_*OpenAI Chat Completions wire format, streaming or non-streaming.
POST/v1/messagesBearer / x-api-keyAnthropic Messages API wire format, streaming or non-streaming.
POST/v1/responsesBearer ct_live_*OpenAI Responses API wire format, streaming or non-streaming, for coding clients such as Codex. model must name a model; auto is refused. A supplier's model whose declaration lists the responses operation is served natively by its endpoint; every other model is served over chat completions, which carries messages, function calls and their outputs. The exchange keeps no response state: send the whole conversation in input on every turn — previous_response_id and store: true answer 422 history_unsupported. Hosted tools such as web_search answer 422 operation_unsupported (in Codex set web_search = "disabled"), and reasoning another backend produced answers 422 history_unavailable. The WebSocket transport is not offered: a WebSocket handshake on GET /v1/responses answers 426 operation_unsupported, on which Codex falls back to HTTP, and any other GET there 422.
GETDELETE/v1/responses/{id}Not offered — the exchange stores no responses, so GET and DELETE answer 422 history_unsupported.
GET/v1/modelsBearer / x-api-key (optional)Routable model catalog in OpenAI format. The key is optional: without one the list is the public catalogue and publicly cached; with one it adds the models of the offers the key's pool accepted, narrows both to the key's allowed models, says in scope which universe was listed, and is cached privately and varied by Authorization and X-Api-Key. An invalid or revoked key answers 401 and a frozen one 403.
GET/v1/models/availabilityBearer / x-api-key (optional)Per-model routable flag over the capacity the caller can reach, plus auto — the model the routing directive resolves to from the operator's preference list right now, or null. Advisory only: true as of computedAt, never a guarantee for a later request.
GET/v1/usageBearer ct_live_*The account's balance and cumulative spend, the calling key's own daily and monthly limits and usage, the remaining budget under the tighter of the key's and the account's caps, and the account's cumulative cache reads and writes.
GET/v1/inference/estimateBearer / x-api-key (optional)Returns an up-front cost preview: resolvedModel — a catalogue id, or with a key a supplier's handle/alias — creditsCost, creditsWei, usdCost, reservedWei — the hold the charge is taken from — and tierFromInputTokens, the context tier the quote was priced at, null on a flat-priced model. model defaults to auto, quoted at the model the exchange chooses for the request you describe — the same per-request choice the send path runs. Describe it with promptTokens, reasoningRequested and toolsPresent (true or false, nothing else parses) and lean it with routing_bias; a bias beside a named model is 422, because there is no choice to lean. A named model asked for reasoning or tools it cannot serve is refused with 422, exactly as the send answers the same request: a catalogue model reasons where its reasoning output is priced and takes tools where its provider does, a supplier's model has the capabilities its declaration of the chat completions operation lists. X-Model-Chooser names what decided: engine, list or degraded. Two things the quote cannot see still move the send — a conversation already pinned to a model is served that model, and a share of auto traffic is held on the operator's order as a control arm — and the hold covers the costliest candidate, so a different model answering never costs more than was held. Name a model to quote exactly what will run. 503 when none has serving capacity or the stored operator route list cannot be read. The quote is advisory: it prices the token counts you pass, and the bill is always the counts the provider reports. The key is optional; with one the quote answers as that key's send would — a model outside its allowed models is 403 model_restricted and auto walks only the models they grant, a key whose account no longer owns or belongs to its pool is 403, and a handle/alias the key's pool is offered is quoted at the supplier's price plus the routing fee, output at most its declared maximum, with the charge, the tier and the hold priced at promptTokens times its declared input reserve ratio, or refused with 422 offer_unavailable where the send would be. The send scales only a prompt's content by that ratio and adds the chat framing unscaled, so a supplier's model is quoted slightly above its real hold — by up to (reserve ratio − 1) × the framing tokens — and near the start of a context tier the quote can price one tier up, or refuse a request the send admits. Without a key such an id is an unknown model; an invalid or revoked key answers 401 and a frozen one 403.

SDKs

The same key drives the OpenAI client in TypeScript and the official anthropic clients against POST /v1/messages. Each label names the SDK version its snippet is pinned to.

TypeScript — openai@^4.76
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.compute.finance/v1",
  apiKey: process.env.COMPUTE_FINANCE_API_KEY!, // ct_live_...
});

const resp = await client.chat.completions.create({
  model: "openai/gpt-5.5",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);
Python — anthropic@0.116
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.compute.finance",
    api_key="ct_live_...",
)

resp = client.messages.create(
    model="anthropic/claude-opus-4.8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.content[0].text)
TypeScript — @anthropic-ai/sdk@^0.120.0
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.compute.finance",
  apiKey: process.env.COMPUTE_FINANCE_API_KEY!, // ct_live_...
});

const resp = await client.messages.create({
  model: "anthropic/claude-opus-4.8",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.content[0].text);

Wire-format deltas

Requests are validated before dispatch, and a refused request bills no tokens. A malformed param returns 422 validation_failed whose issues[] name each offending field where it sits — inside a param that takes several shapes, in the shape your value took. A param the exchange declines for a reason of its own — on /v1/responses, a hosted tool, stored response state or reasoning another backend produced — returns 422 under that reason's code (operation_unsupported, history_unsupported, history_unavailable) with error.param naming the field and no issues[]. A param the serving provider cannot honour is either refused or ignored under the published policy below.

Provider capability gating. Advanced features (tools, structured outputs) only work on providers that support them natively — currently openai and anthropic. A single named model on another provider returns 422 validation_failed; inside a models[] list, such an entry is skipped and the request fails only if no listed entry supports the feature.

Every parameter has one fate. It takes effect, it is refused with a 422 naming it, or it is ignored under this policy — never a silent no-op. Anthropic-served models expose no equivalent for frequency_penalty, presence_penalty, seed, logit_bias, logprobs and top_logprobs, so those are dropped and the request is served; on every other provider they are forwarded and the vendor decides. tool_choice and parallel_tool_calls sent without a non-empty tools list govern nothing and are dropped along with it. Current Claude models accept temperature only at 1.0 and top_p only at 0.99 or above, so any other value is refused naming the accepted one rather than passed on to fail at the vendor.

End-user identifiers. user — and metadata.user_id on the Messages endpoint — reaches every provider as a stable, irreversible fingerprint of the identifier and your account, computed before the request leaves the exchange, or is dropped entirely where the operator has configured no fingerprint key. The same end user carries the same marker through every key of your account, while another account sending the same identifier gets an unrelated one. A vendor can attribute repeat abuse to one end user instead of banning the whole contributor key, cannot link your end users to another account's, and the identifier you send reaches no third party.

OpenAI Chat Completions

Supported params: model, messages, stream, response_format, tools, tool_choice, parallel_tool_calls, reasoning_effort, reasoning, plus the standard sampling / limit / logprobs family.

Also accepted: models (ordered fallback list, 1–8 entries), conversation_id, routing_bias — cheaper, balanced or better, which leans an auto choice and is refused anywhere else.

Not supported (422): legacy functions / function_call (use tools / tool_choice), n &gt; 1, non-text content parts.

Anthropic Messages

Supported params: model, messages, max_tokens, system, stream, tools, tool_choice, thinking, plus stop_sequences, metadata.user_id, and the sampling family (temperature, top_p).

Content blocks: text, tool_use, tool_result; a cache_control marker on a text block, a system block, a text block inside a tool_result, or a tools[] entry reaches Anthropic in its native form. Also accepted: models (ordered fallback list) and routing_bias. Extra fields on message objects are rejected with 422.

Responses API

Two ways to serve. POST /v1/responses serves a named model — auto is refused — in one of two modes its declaration decides and the request never does. Native: a supplier's model whose declaration lists the Responses operation; the request goes to the endpoint's own /responses with store: false, and its events come back with id, model and usage set by the exchange. Mapped: every other model, catalogue models included; the request is translated into a chat completion and the answer back into Responses events. What each mode accepts:

Part of the requestNativeMapped
Fieldsmodel, input, instructions, tools, tool_choice, parallel_tool_calls, reasoning, text, max_output_tokens, store, include, stream, stream_options, prompt_cache_key, metadata, client_metadata, user, truncation, service_tiermodel, input, instructions, tools, tool_choice, parallel_tool_calls, reasoning, text, max_output_tokens, store, include, stream, stream_options, prompt_cache_key, metadata, client_metadata, user, truncation, service_tier
Input items (input[].type)message, function_call, function_call_output, custom_tool_call, custom_tool_call_output, reasoning, tool_search_call, tool_search_output, additional_toolsmessage, function_call, function_call_output, custom_tool_call, custom_tool_call_output, tool_search_call, tool_search_output, additional_tools
Content partsinput_text, output_textinput_text, output_text
Tools (tools[].type)function, custom, namespace, tool_searchfunction, custom, namespace, tool_search

Everything else is refused, never stripped — a 422 naming what was sent. A field outside the table — models included, since /v1/responses takes no fallback chain — and an item, content part or tool type the exchange does not know answer validation_failed, the latter listing the accepted ones. One it knows and does not serve for the model's mode answers operation_unsupported: a hosted tool such as web_search, an item or part the table does not list — images, files and audio included — or a tool type the table does not list for that mode. history_unsupported: previous_response_id, store: true, an item_reference, and reading or deleting a stored response through GET or DELETE /v1/responses/{id} — the exchange keeps none. history_unavailable: a reasoning item on a mapped model, or one another backend produced. The WebSocket transport is not offered: its handshake on GET /v1/responses answers 426.

Namespaces on a mapped model. Function and custom tools inside a namespace reach Chat Completions with the namespace and tool name joined by __. Responses restores each call's own name, namespace and function/custom type; replay uses the same chat name. Names must match ^[a-zA-Z0-9_-]{1,64}$ and remain unique. Invalid or colliding names, and a tool_choice forcing a tool inside a namespace, return operation_unsupported. A forced plain tool must be active and match its declared type.

Custom tools and grammar. Chat Completions and Responses preserve raw custom-tool input and its text, Lark or regex format. Read customToolFormats from GET /v1/models: on a private model, check the operation that will serve the request. Use only advertised formats; an empty list does not advertise custom-tool support. A request requiring an unadvertised format returns validation_failed before inference. In Responses, return custom_tool_call_output with the original call_id, and replay the call and output in subsequent requests. Custom input streams through response.custom_tool_call_input.delta and response.custom_tool_call_input.done. This applies to eager tools and tools loaded through search.

Discover tools on demand. Choose a model that supports tools. Client-executed search works through mapped Chat Completions or a compatible native Responses backend. Add tool_search to tools. Keep the full tool registry in your client. When the model returns tool_search_call, search that registry using its arguments, then append the call and a tool_search_output to input. Set the output's execution to client, copy the call's call_id, and put only the discovered definitions in tools. Execute the resulting function_call and return its function_call_output as usual.

Client-executed search: tools entry
{
  "type": "tool_search",
  "execution": "client",
  "parameters": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string"
      }
    },
    "required": [
      "query"
    ],
    "additionalProperties": false
  }
}

Keep discovered tools available. Send the full conversation history on each turn, including the search calls, their outputs with the discovered definitions, and subsequent tool calls and results. The history makes those tools available again; the unselected registry stays in your client. The exchange does not store this state, and previous_response_id is unsupported. A request may also add definitions at a chosen point in history with {"type":"additional_tools","role":"developer","tools":[...]}. Loaded definitions obey the same tool restrictions as top-level tools.

Support and alternatives. On mapped models, client search uses ordinary function calls; the exchange returns them as tool_search_call items. Only eager tools and tools activated by search outputs or additional_tools reach the chat model. Candidate tools with defer_loading: true stay unloaded until discovered. Loaded custom tools require the format advertised for the serving operation. For backend-executed search, use a compatible native Responses model, send {"type":"tool_search"} and mark candidate functions or custom tools with defer_loading: true; this sends candidate definitions to the backend. Mapped models reject backend-executed search with operation_unsupported. Native support depends on the endpoint's model and connection; a backend rejection returns upstream_rejected. OpenAI's ChatGPT token-sharing connection does not accept native tool_search. See the OpenAI tool-search guide and ChatGPT connection limitations.

Field notes. max_output_tokens bounds the hold, and natively is capped at the model's declared maximum. A reasoning.effort other than none needs a model with the reasoning capability, and on a mapped model is one of none, low, medium, high. A json_schema or json_object text.format needs structured outputs. metadata, client_metadata and service_tier are accepted and dropped, and so, on a mapped model, are include, stream_options and truncation.

Events. A mapped model streams response.created and response.in_progress, then its text as a message — response.output_item.added, response.content_part.added, response.output_text.delta, response.output_text.done, response.content_part.done, response.output_item.done — until its first function call starts. That call streams live: response.output_item.added, its arguments in response.function_call_arguments.delta, response.function_call_arguments.done, response.output_item.done. A call that starts while another streams is held until the answer finishes and then sent whole, in index order, followed by any text that came after the first call as a message of its own. It ends with response.completed, or response.incomplete when the answer stopped at its length or a filter, and emits no reasoning. A native model's events are relayed in order, renumbered. Nothing is sent before a stream's first output, the response headers included, so until then a client waits on the HTTP response. From its first event on, a stream that has written nothing for 15 seconds writes response.in_progress with the response so far, until its terminal event, so a client's idle timeout does not fire while a model works silently. The terminal event carries usage, the counts billed, or null when nothing was billed; there is no x_credits_used.

Failures inside a stream. A stream that breaks after its first output and before its end — a native endpoint's terminal event, or the finish reason of a mapped model's chat answer — ends with response.failed carrying stream_interrupted and no response.completed; one that breaks after its end is a completed answer, a native one billed by the usage its terminal event carried. An input longer than the model's context answers a streamed request 200 with response.failed carrying context_length_exceeded — the code that tells a Responses client its context is full, so it can trim or compact its history — and an unstreamed one 422. Compaction is no server operation: a client compacts with an ordinary request, reserved and billed like any other. Codex settings are under Private endpoints → Codex.

Prompt caching

What you may send. On /v1/chat/completions a message's content is a string or an array of up to 50 text parts ({"type":"text","text":"…"}); a part of any other type — image_url and the rest — is refused with 422 validation_failed naming the offending part type. On /v1/messages a message's content is a string or up to 200 blocks of type text, tool_use or tool_result, system is a string or up to 20 text blocks, and a tool_result holds up to 50 text blocks; any other block type is refused the same way, naming it. Every text part counts toward the input estimate that sizes the reservation and toward the bill.

Where the breakpoint goes. A text part may carry cache_control — {"type":"ephemeral"}, optionally with a ttl of 5m (the default) or 1h; any other value is refused before the request is priced. The marker is accepted on a message text part, on a system text block, on a text block inside a tool_result, and on a tools[] entry. It is refused on a part with no text — a breakpoint must ride text — and on the tool_result block itself rather than on a text block inside it. How many breakpoints one request may carry is capped by the provider; above that cap the provider refuses the request, and its own explanation comes back in the error message.

Marked request body
{
  "model": "anthropic/claude-opus-4.8",
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "You are a contract analyst. Answer only from the contract below.",
          "cache_control": { "type": "ephemeral", "ttl": "1h" }
        }
      ]
    },
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "<the full contract text>", "cache_control": { "type": "ephemeral" } },
        { "type": "text", "text": "Which termination clauses changed?" }
      ]
    }
  ]
}

A provider that cannot express one. The marker reaches Anthropic-served models in Anthropic's own block form. On every other provider the text parts are joined into one string and the marker is removed before the call — the request is served normally, with no error and no warning. Those vendors may still cache implicitly: where a vendor reports the hit in the usage shape the exchange reads for that vendor it is billed at the model's cache-read price, and where a vendor reports a hit in any other shape, those tokens are billed as fresh input.

What it costs. A cache write is billed at the model's cache-write price for the ttl requested — 5m and 1h are priced separately — and a later hit at its cache-read price. Both are components of the same published price list as input and output, under the same routing markup. Cache usage comes back in the wire format you called: usage.prompt_tokens_details.cached_tokens on /v1/chat/completions, usage.cache_read_input_tokens with writes under usage.cache_creation on /v1/messages. GET /v1/inference/estimate is not cache-aware: a hit is not knowable before the request runs, so the quote prices the whole input as fresh. GET /v1/usage reports the same tokens cumulatively for the account behind the key — cachedInputTokens for reads, cacheWrite5mTokens and cacheWrite1hTokens for writes at each lifetime. Each is null until at least one settled request on the account recorded a non-zero count of that kind, so an account that has never used caching carries null for all three, and the counters are incremented from the same breakdown the receipt stores: exactly the token counts the charges were computed from. Both write lifetimes collapse into usage.prompt_tokens_details.cache_creation_tokens on /v1/chat/completions, so the two cumulative write counters reconcile per request only on /v1/messages, which splits them.

Reasoning

Two controls switch reasoning on and map onto the same provider wiring: reasoning_effort from the OpenAI wire format, and the structured reasoning object of the OpenRouter convention. An OpenRouter-native client works unchanged.

FieldMeaning
reasoning.effortReasoning depth: low, medium or high. Equivalent to reasoning_effort.
reasoning.max_tokensExplicit thinking budget, 1024–200000 tokens. Mutually exclusive with effort.
reasoning.enabledtrue without a budget uses effort medium; false switches reasoning off.
reasoning.excludeThink, but keep the reasoning out of the response.

Any reasoning object without enabled: false switches reasoning on: a bare reasoning: {} and reasoning: {"exclude": true} both run at effort medium and are billed for the thinking tokens they generate.

Contradictory values across the two controls are 422 validation_failed naming both fields — never a silent priority. That covers two different effort levels, an effort together with reasoning.max_tokens, and enabled: false alongside any requested budget. Agreeing values are accepted, and exclude combines freely with either control.

The effort level becomes a thinking budget as a share of max_tokens (default 4096), floored at 1024 tokens — Anthropic's minimum, applied on every provider. The budget must stay below max_tokens; a request that leaves no room for an answer returns 422 validation_failed naming both numbers, before it reaches a provider and before any credits move.

EffortThinking budget
low20% of max_tokens
medium50% of max_tokens
high80% of max_tokens

On OpenAI-shaped providers the effort level is forwarded as reasoning_effort; an explicit reasoning.max_tokens maps onto the closest effort bucket in the same table.

Reasoning is available on a catalogue model exactly where its reasoning output is priced in the catalogue, and on a supplier's model where its declaration lists reasoning for the operation called. A single named model without it returns 422 validation_failed; inside a models[] list, such an entry is skipped and the request fails only if no listed entry can reason. To check a catalogue model before you send it: GET /v1/oracle/models — and GET /v1/oracle/catalog for models outside the basket — returns a reasoning.reasoningOutput price block for exactly the models that can reason, and null for the rest; a supplier's model lists its capabilities per operation in GET /v1/models sent with your key.

The assistant message carries a reasoning field alongside content; streaming chunks carry delta.reasoning before the content deltas. The name is the same on every provider — a model whose own API returns its thinking under reasoning_content is renamed before the response leaves the exchange, streaming and non-streaming alike, and exclude withholds it just the same. For MiniMax conversations, preserve the returned assistant reasoning field in messages on subsequent requests. It is replayed to MiniMax and counted as input; other providers do not receive it.

Non-streaming response
{
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "42",
      "reasoning": "The question asks for the answer to life, the universe and everything..."
    },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 18, "completion_tokens": 512, "total_tokens": 530 }
}
Streaming chunks
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"anthropic/claude-opus-4.8","choices":[{"index":0,"delta":{"reasoning":"The question asks"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"anthropic/claude-opus-4.8","choices":[{"index":0,"delta":{"reasoning":" for the answer..."},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"anthropic/claude-opus-4.8","choices":[{"index":0,"delta":{"content":"42"},"finish_reason":null}]}

With reasoning.exclude: true the model still reasons and the reasoning tokens are still generated and billed — only the output is withheld. Hiding the reasoning does not make it free.

On /v1/messages the native thinking parameter sets the same budget as reasoning.max_tokens: {"type":"enabled","budget_tokens":N} obeys the same floor and the same below-max_tokens rule, while {"type":"disabled"} switches reasoning off and no thinking parameter is forwarded at all. If the request falls through to an OpenAI-shaped entry, the budget maps onto the closest effort bucket. Reasoning comes back as thinking content blocks ahead of the text block, carrying the signature Anthropic issued when an Anthropic model served the request and an empty signature when another provider did; streaming emits thinking_delta events on that block, plus signature_delta when a signature was issued.

Message content blocks accept text, tool_use and tool_result; a thinking block in an assistant turn is rejected with 422 validation_failed. Strip thinking blocks from an assistant turn before you replay it.

Reasoning tokens are output tokens: they are counted in completion_tokens and billed at the model's output rate. There is no separate reasoning charge.

Streaming

All three endpoints stream Server-Sent Events (Accept: text/event-stream) when stream: true, each in its own wire format: OpenAI Chat Completions and Anthropic Messages below, and the OpenAI Responses events on /v1/responses.

OpenAI /v1/chat/completions
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"openai/gpt-5.5","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"openai/gpt-5.5","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
...
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"openai/gpt-5.5","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":5,"total_tokens":15},"x_credits_used":"1234","x_credits_remaining":"98765","x_ratelimit_requests_remaining":123}
data: [DONE]
Anthropic /v1/messages
event: message_start
data: {"type":"message_start","message":{"id":"msg_...","type":"message","role":"assistant","content":[],"model":"anthropic/claude-opus-4.8","stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":10,"output_tokens":0}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":5}}

event: message_stop
data: {"type":"message_stop"}

Stop reasons are translated between wire formats: OpenAI stop ↔ Anthropic end_turn; length ↔ max_tokens; tool_calls ↔ tool_use.

The streaming final chunk also mirrors x_credits_used, x_credits_remaining, and x_ratelimit_requests_remaining into the body.

Response headers

HeaderMeaning
X-Model-UsedModel that actually answered this request, in `vendor/model` form, or `handle/alias` for a supplier's model.
X-Model-RequestedModel the exchange set out to serve, in `vendor/model` form or `handle/alias` for a supplier's model — the one the request named, or the head of the chain `auto` resolved to.
X-Fallback-Used`true` exactly when the model that answered is not the one `X-Model-Requested` names.
X-Model-ChooserOn every `auto` answer, what picked the model: `engine` — a choice made for this request; `pin` — the model this conversation is already on; `list` — the operator's preference order; `degraded` — the per-request choice could not be made, so the preference order served. Absent when the request named a model.
X-ProviderVendor slug of the provider that served the request, or the supplier's handle when a supplier's endpoint served it.
X-Routing-StrategyHow the capacity was chosen: `sticky` or `weighted-random` for a provider key, `endpoint` when a supplier's model was served by its own endpoint, or `failover` after a retry or a fallback entry took over.
X-Request-IdIdentifier of this request; every response the API sends carries it, a refusal or an error included. Quote it in a support request: for a request that reserved a charge it finds the full record, for any other its log lines.
X-Compute-UsedWei debited for this request after settlement.
X-Compute-RemainingRemaining $COMPUTE balance for the buyer account, in wei.
X-Key-Daily-RemainingRemaining daily spending cap for this key, in wei — `unlimited` if unset.
X-Key-Monthly-RemainingRemaining monthly spending cap for this key.
X-RateLimit-LimitCeiling of the tightest active rate-limit bucket.
X-RateLimit-RemainingRemaining capacity in the tightest bucket.
X-RateLimit-ResetEpoch seconds when the tightest bucket resets.

Errors

Every error response follows the envelope below. Branch on error.code rather than HTTP status — several codes can share the same status.

envelope
{
  "error": {
    "message": "The Bearer API key is missing, malformed, or not recognized.",
    "type": "invalid_request_error",
    "code": "invalid_api_key",
    "param": "authorization",                    // optional, set when the error binds to a field
    "details": { ... },                          // optional, code-specific structured payload
    "issues": [ ... ]                            // present when one or more fields fail validation
  }
}

type is derived from code with one exception, inside code: validation_failed — the 422 for a request the exchange refuses itself: a body that fails schema validation answers validation_error and lists every offending field in issues[], while a body that parsed and was then refused further in — a parameter the exchange knows the target provider refuses, a provider-capability mismatch, an input above the model's window — answers invalid_request_error and carries no issues[], so only type tells the two apart. A refusal the provider itself returned is the other 422, code: upstream_rejected, and always answers invalid_request_error.

CodeStatusTypeMeaningWhen it occurs
unauthorized401invalid_request_errorAuthentication is required to access this endpoint.The session cookie is missing or invalid, the Bearer token is absent, or the timestamp on a signed request is outside the 5-minute freshness window.
forbidden403forbiddenThe caller is authenticated but is not allowed to perform this action.The caller lacks the required role, a request was signed by an address different from the authenticated wallet, or an inference API key stopped reaching supply while its request was in flight: the key's account left its pool between authentication and routing, or the admission a supplier's model runs before each attempt found the key revoked or frozen or its account outside the pool. A key revoked or frozen before the request arrives answers `api_key_revoked` or `api_key_frozen` instead.
invalid_api_key401invalid_request_errorThe Bearer API key is missing, malformed, or not recognized.The token is empty, does not use the `ct_live_` format, or matches no key the exchange issued. A key that exists but is revoked or frozen answers with its own code instead.
api_key_frozen403forbiddenThe API key is currently frozen and cannot be used for requests.The key was frozen from the API keys page or by support. Reactivate it from the API keys page, or contact support if it was frozen by an administrator.
api_key_revoked401invalid_request_errorThe API key has been revoked and can no longer be used.The key was revoked from the API keys page. Revocation is permanent — issue a new key to continue.
model_restricted403forbiddenThe requested model is not in this key's allowed-models list.The key was restricted to a specific set of models; the request referenced a model outside that set.
validation_failed422invalid_request_errorThe request failed validation. A schema failure lists every issue in `error.issues[]`; a single-field failure names that field in `error.param`.One or more fields — of the body, the query string, or the path — are missing, of the wrong type, or outside their allowed range.
upstream_rejected422invalid_request_errorThe upstream the request was routed to refused it as invalid.The request passed the exchange's own checks and reached an upstream — a vendor or a supplier's endpoint — which rejected it as invalid: a limit or parameter only that upstream enforces. `error.message` carries the upstream's own reason after the vendor slug or supplier handle that names it, cut to 200 characters, and `details.upstreamStatus` is the HTTP status the upstream answered with, or `null` when it reported the refusal without one — inside an answer it had begun with `200`, such as a Responses `response.failed`. Sending the same request again fails the same way; change the request. An upstream failure that is not a refusal of the request is retried on other capacity and never answers with this code.
method_not_allowed405invalid_request_errorThe endpoint exists but does not accept this HTTP method.A request used a method the route does not support; the `Allow` response header lists the accepted methods.
payload_too_large413invalid_request_errorThe request body is larger than the exchange accepts.The body exceeded the fixed body ceiling, which covers the largest context the exchange serves; it is refused before it is parsed, so no field-level detail is available.
offer_unavailable422invalid_request_errorA model a supplier offers to the key's pool cannot serve this request.The request named a supplier's `handle/alias` model that cannot serve it, and no entry of the chain was sent upstream: `details.model` names it, `details.reason` says why — `awaiting_acceptance` (the pool owner has not accepted its current declaration), `price_above_ceiling` (the supplier's price at this request's input size is above the ceilings the pool owner accepted), `endpoint_disabled`, `endpoint_removed`, `model_retired`, `offer_closed` (the offer of its endpoint to the pool was revoked or rejected by the pool owner or withdrawn by the supplier), `validation_failed` (its endpoint has not passed validation for the requested operation) or `cooldown` (its endpoint failed the requested operation repeatedly and becomes available again on its own shortly) — and `details.actor` who has to act first for it to serve again, `pool_owner` or `supplier`: a closed offer also needs the pool owner to accept the supplier's new share, a retired model the owner to accept its new declaration, and a cooling-down endpoint is the supplier's to fix, while a removed endpoint never serves again and its `actor` is `null`. Inside `models[]` such an entry is skipped, also when it becomes unavailable while the request is being routed, and a request whose other entries were sent upstream and failed answers `all_routes_exhausted` instead. Nothing was charged.
operation_unsupported422invalid_request_errorThe request uses a feature the exchange does not offer on this endpoint.`POST /v1/responses` named a hosted tool — `web_search` (in Codex, set `web_search = "disabled"`), `file_search`, `code_interpreter`, `mcp` and the rest — or an input item or content part the exchange does not carry, such as `input_image`, `input_file` or a compaction item; or a model served over chat completions was sent server-executed `tool_search` or its history (use `execution: "client"` with a `parameters` schema and perform discovery in the client), a `tool_choice` naming a tool inside a `namespace`, or a tool whose chat name — `<namespace>__<name>` inside a namespace — does not match `^[a-zA-Z0-9_-]{1,64}$` or names another tool. `GET /v1/responses` answers it too, because the WebSocket transport is not offered: `426` on a WebSocket handshake, on which Codex falls back to HTTP, and `422` otherwise. `error.param` names what was refused — the field, with the item's index, or `transport`. Nothing was charged.
history_unsupported422invalid_request_errorThe request relies on response state the exchange does not keep.`POST /v1/responses` carried `previous_response_id`, `store: true` or an `item_reference` input item, or a stored response was retrieved or deleted. The exchange stores no responses: send the whole conversation — messages, function calls and their outputs — in `input` on every turn, with `store` left out or `false`. `error.param` names the field. Nothing was charged.
history_unavailable422invalid_request_errorThe conversation replays state only another backend can continue.`input` replayed a `reasoning` item the requested model cannot continue: the model is served over chat completions, which carries no reasoning state, or the item's encrypted reasoning was produced by another model's backend. Continue on the model that produced it, or start the conversation anew; the exchange never drops history to make a request fit. `error.param` names the item. Nothing was charged.
insufficient_balance402insufficient_quotaThe account's $COMPUTE balance is below the requested amount.Triggered when withdrawing more than the balance, or when an inference request would exceed the balance after billing.
spending_limit_reached429rate_limit_errorA spending cap has been reached.This request's reserved amount, added to what was already spent and to what requests still in flight hold, would exceed a daily or monthly cap on the key, or a daily, weekly or monthly cap on the account; `details.scope` names which carried it.
all_routes_exhausted502server_errorNo upstream capacity could serve the routed models.Every route the exchange tried for the requested models failed before any output — the capacity serving them was unavailable, rate-limited, cooling down or answered with an error. Nothing was charged; retry shortly.
deadline_exceeded504server_errorThe request ran out of time before any upstream produced output.Every request carries one time budget: an unstreamed request's lets each upstream attempt it may make run to its own timeout, up to the longest the exchange holds a request open, and a streamed request's is that longest hold. The budget ran out while the exchange was still routing — attempts were slow to answer, or cut at their timeouts — so no output reached the caller and nothing was charged. Retrying may succeed.
rate_limited429rate_limit_errorA rate or concurrency limit this request falls under was reached.The request hit a request-rate cap on this API route, or the pool's RPM/TPM cap — then `details.scope` is `pool` — or the concurrency, request-rate or token-rate limit of the supplier endpoint serving the named model — then `details.scope` is `endpoint`, `details.model` names the model, and inside `models[]` the next entry is tried instead. A route's request-rate cap names whose allowance was spent: `details.scope` is `caller` when the signed-in wallet or app grant spent its own, `address` when its network address spent the allowance every caller behind it shares, which is the only allowance an anonymous caller has. An endpoint validation is refused with it too: `details.scope` is `endpoint` when that endpoint was validated less than a minute after a validation of it that sent requests finished, `wallet` when the wallet already ran as many validations that sent requests as it may this minute or this hour. A route's request-rate cap and an endpoint validation both say how long to wait in `details.retryAfterSeconds` and the `Retry-After` header — for a request-rate cap, the longest wait among the windows that refused the request.
stream_interrupted500server_errorThe SSE stream aborted before completion.The upstream's stream dropped or ended without finishing after it had started delivering output, or the request ran out of its time budget while the answer was streaming. The exchange retries only before the first output, so this request is not retried. On a catalogue model an answer its vendor broke is not charged, and one the time budget cut is charged for the prompt and the output streamed before the cut; a supplier's model is charged by the usage its endpoint reported before the stream ended when that usage is valid, and not at all otherwise. This error is delivered inside the SSE body, not as an HTTP status.
internal_error500server_errorAn unexpected server-side failure occurred.A fallback for exceptions that no other error code describes; the failure is logged for investigation.
service_unavailable503server_errorA dependency, a setting or the capacity this request needs is unavailable.A dependency needed for this request is unreachable — security-critical paths intentionally reject rather than degrade — or no capacity serving the requested models was available to try, so nothing was sent upstream and nothing was charged; retry shortly, or name another model. An operator setting that cannot be read, such as the route list `auto` walks, answers it until an operator fixes it, so name a model rather than retry.

Rate limits

Per-key. Each API key can carry optional daily and monthly $COMPUTE caps, and the account behind it carries daily, weekly and monthly caps of its own. Exceeding any of them returns 429 spending_limit_reached, and a request in flight counts against them at its reserved amount until it settles; what is left of the key's caps is exposed in the X-Key-*-Remaining headers.

Per-pool. Each provider pool has RPM and TPM ceilings. Exceeding either returns 429 rate_limited with details.scope: "pool". A pool's model served by a supplier's own endpoint is also bounded by the concurrency, RPM and TPM limits the supplier set on that endpoint: at one of them a request for that model alone returns the same error with details.scope: "endpoint", and inside models[] the next entry is tried instead.

GET /v1/inference/estimate is throttled to 10 requests per second per source IP; it requires no authentication and does not consume $COMPUTE.

Request size

Body ceiling. A request body may be up to 4194304 bytes (4 MiB) — the room the largest context the exchange serves, 1048576 input tokens, needs on the wire. A larger body is refused with 413 before it is parsed. The ceiling is fixed for the whole exchange and applies to /v1/chat/completions, /v1/messages and /v1/responses alike.

Per-model maximum. A model may declare the context window its vendor actually serves. A request whose estimated input exceeds it fails with 422 validation_failed naming the model and its limit — before the request reaches a provider and before any $COMPUTE is reserved, so an oversized attempt costs nothing. A model that declares no maximum is bounded only by the body ceiling. GET /v1/inference/estimate runs the same check, so you can size a request before you send it. Every declared window is published as maxInputTokens on GET /v1/models and in the full catalog at https://api.compute.finance/v1/oracle/catalog, absent on a model that declares none. On /v1/responses a streamed request gets that answer in-band instead — 200 with response.failed carrying context_length_exceeded, the code that tells a Responses client its context is full, so it can trim or compact its history, and the one it also receives when the upstream itself refuses the input as too long; an unstreamed request keeps the 422.

Inside a fallback chain. An entry of models[] that the exchange cannot serve right now is skipped and the next candidate takes over. An input too long for an entry is not skipped: the length is a property of your request, so the request fails naming that entry rather than quietly falling through to a model you did not ask for. Only model: "auto" narrows on length — there the exchange picked the candidates, so it routes to one whose window holds the request and returns 422 only when none does.

Billing

Cost is estimated up-front, reserved from the balance, then settled against actual token usage. The X-Compute-Used and X-Compute-Remaining headers report the final debit and remaining balance. An insufficient balance returns 402; hitting a per-key or per-account cap returns 429. An account with nothing left to spend is refused before its request is estimated, so a request you could never pay for is never priced.

The estimate is advisory; the bill is not. The input estimate that sizes your reservation and picks the context tier it is held at counts your message text, your tool schema and response format, and the per-message chat framing the provider wraps every turn in. Name a model whose provider publishes its own token counter and the estimate is that vendor’s count of your request — an Anthropic model is counted by Anthropic, and no chat framing is added on top, because that count already carries it. Everything else is counted locally through the o200k_base BPE vocabulary at a pinned tokenizer version and scaled into the target model’s vocabulary by that vendor’s fixed ratio, so the same request reserves the same amount — above a small minimum floor, and outside the rare fallback where the vocabulary cannot be loaded. auto is always counted that way, since the serving model is chosen after the hold is taken, and so is a vendor counter that declines or times out; each candidate model is counted in its own vocabulary and your reservation is held at the costliest of them. It never decides what you pay: settlement charges the token counts the provider reported, at the tier those counts select. GET /v1/inference/estimate tokenizes nothing — it prices the promptTokens you hand it, so counting your prompt with the same vocabulary and adding four tokens per message plus three for the reply quotes a locally counted reservation; a named model its vendor counts holds a different amount, which only that vendor’s own count reproduces. A supplier’s model quotes slightly above its hold, because the quote scales the framing by the model’s input reserve ratio along with the content.

A model may carry a ladder of context tiers — ordered input-token thresholds, each with its own input and output price. The tier follows the whole input side of the request (prompt plus cache reads plus cache writes), and an input landing exactly on a threshold is priced at the higher tier. Settlement re-selects the tier from the tokens the provider reported and is what you pay; the reservation’s tier only sets how much was held. A cache or reasoning price the catalogue attests is single-level, but a kind it does not price separately is billed at its side’s rate, that side’s context tier included. A flat-priced model — one with no ladder — costs the same at every length. Quote a specific size with GET /v1/inference/estimate — its tierFromInputTokens names the tier your bill will use for that input.

A supplier's model in a private pool is billed only by the usage its endpoint reports with the answer, never above the cap held for it before dispatch — see Private endpoints → Money.

Machine-readable specifications

OpenAPI YAML · OpenAPI JSON · llms-full.txt

Private endpoints

Use models from a supplier you trust through your private pool. The supplier connects an endpoint and sets prices; the pool owner approves the offer; members use it with a Compute Finance API key.

Choose the setup for your role below. You can provide models, manage a pool and use its models with the same account.

Connect your endpoint in Earn & Credits, manage access in Pools and create a pool key in API Keys. Every step can be done in the app.

Before using the API examples

Your session token. GET /v1/auth/payload?address=… answers the fields of a sign-in message (SIWE, EIP-4361) for your wallet address. Build the message text from them as EIP-4361 lays it out — invalid_before is its Not Before line — sign that text with the wallet (personal_sign, EIP-191) and send the payload unchanged, with the signature, to POST /v1/auth/login as { payload, signature }. The answer's token is $CF_SESSION, valid for 30 days, and POST /v1/auth/logout revokes it. An account that signs in by email keeps its wallet inside the app, so it does every supplier and pool-owner step there, on the pages above.

The examples need curl and jq. Set export CF_API=https://api.compute.finance, then supply the variables shown above each example. Run: create a pool → connect and share the endpoint → accept the offer → create a buyer key → call a model. Run the supplier's price-change and withdrawal example only after testing: it changes the price and removes access. Choose your own $HANDLE and $ALIAS; the model id is $HANDLE/$ALIAS.

Suppliers: connect an endpoint

  1. Connect your endpoint. Choose a permanent supplier handle, review the terms, then add your HTTPS base URL and endpoint credential.
  2. Add and check your models. Set each model's name, supported APIs, limits and prices. Test the connection and resolve any failed checks before sharing.
  3. Share with a pool. Ask its owner for the Pool ID. The owner reviews your offer before members can use it. If you manage that pool, you can accept it while sharing. Track usage and payments in the endpoint's earnings.
Endpoint requirements and supplier API examples

Handle. Register a handle once: 3 to 32 lowercase letters, digits and -, starting and ending with a letter or digit. A handle another supplier holds, a vendor slug and a few reserved words are refused with supplier_handle_taken. The handle prefixes the id handle/alias of every model you declare and never changes. Registering accepts the standing terms of version 2, which GET /v1/supplier lists and which stay the terms on record for your handle:

  • Payment is capped at the cost of the reserved usage limits for the endpoint that serves the request. Usage above that cap is unpaid.
  • Your model mappings, operations, capabilities and limits must hold for every backend your endpoint uses.
  • Pools rely on your claims about models and prompt privacy; Compute Finance does not verify them. Reported usage is checked for consistency, not measured independently.
  • Each request includes the full conversation and asks your endpoint not to store it. Your endpoint must work without relying on stored history.
  • Payment requires valid usage in the response. A request is unpaid if the exchange stops it before usage arrives, including at its deadline or after receiving a client disconnect.

Connect. POST /v1/supplier/endpoints takes a label, baseUrl, authScheme and credential. The base URL usually ends in /v1; the exchange appends /chat/completions or /responses. Use BEARER for an Authorization: Bearer credential or X_API_KEY for x-api-key. Credentials are encrypted and cannot be read back; use PATCH to replace one. Optional concurrencyLimit, rpmLimit and tpmLimit apply across all pools.

What the endpoint must do.

  • Speak the OpenAI wire format at {baseUrl}/chat/completions, and at {baseUrl}/responses for a model that declares the Responses operation. Answer stream: false with one JSON document and stream: true with server-sent events, never one for the other.
  • Report usage with every answer: usage on a document, on the last chunk of a chat stream — the request asks for it with stream_options.include_usage — and on response.completed. Report the count of every cached or reasoning kind the price's reportedUsageKinds lists; an answer without valid usage is not paid. See Money.
  • Serve HTTPS on a publicly trusted certificate, at a host that resolves only to public addresses. The base URL carries no user info, query or fragment, and redirects are not followed. The exchange calls from cloud egress with no fixed address, so an IP allowlist cannot admit it: the credential is the gate.
  • Keep a document, and each event of a stream, within 4 MiB and a whole stream within 64 MiB. A larger answer counts as a failed attempt before its first output; after it, it ends the stream with stream_interrupted.
  • Requests use store: false and include the conversation needed for the answer. The exchange replaces user and prompt_cache_key with keyed digests; prompt contents still reach your endpoint.
  • If your endpoint retries internally, it may report how many attempts it made in an x-cf-upstream-attempts response header; the count is recorded beside the exchange's own.

Declarations. POST /v1/supplier/endpoints/:id/models declares one model together with its first price: the alias — lowercase letters, digits, . and -, at most 100 characters, never auto, live on one of your endpoints at a time — the upstreamModel your endpoint is sent, the operations it serves, each with its own capabilities, the contextWindow, the required maxOutputTokens — the most your model answers with; a client's lower limit is passed on, and usage reported far beyond the request's bound is not paid — and the inputReserveRatio, from 1 to 2 and 1.5 by default. The exchange counts a prompt with its own tokenizer and reserves that count times the ratio, so set it to how far your model's tokenizer can exceed that count. An endpoint holds at most 100 live declarations.

OperationNameEndpoint path and what it serves
chat_completionsChat CompletionsPOST {baseUrl}/chat/completions. Serves /v1/chat/completions and /v1/messages, and /v1/responses translated into chat completions.
responsesResponsesPOST {baseUrl}/responses. Serves /v1/responses natively: the endpoint's events are relayed and its encrypted reasoning carries between turns.
CapabilityNameWhat it admits
toolsTool callsOn chat completions, a non-empty tools, any tool_choice other than none, or a tool turn; on Responses, a non-empty tools, a tool_choice other than none or auto, or a tool call or tool output in input. Validation forces one tool call.
structured_outputsStructured outputsA JSON-schema or JSON-object response_format, or the same as text.format on Responses. Validation asks for an answer that follows a schema.
reasoningReasoningA request for reasoning — on chat completions a reasoning effort or a reasoning object that does not disable it, on Responses an effort other than none. Validation allows the answer more output tokens.

Custom tool formats. Under an operation with Tools enabled, select only the custom formats its endpoint actually supports: text, lark or regex. The API field is operations[].customToolFormats. Validation probes each declared format; changing the list creates a new declaration that pool owners must accept. Buyers see these formats for each operation in the pool model list and GET /v1/models.

Changing a model. Changing its alias, upstream model, operations or capabilities requires a new passing connection test and pool-owner acceptance before it can serve again. Limits (contextWindow, maxOutputTokens and inputReserveRatio) can be updated without re-acceptance. DELETE retires the model.

Prices. The app takes USD per million tokens. The API uses integer strings with 18 decimal places: "600000000000000000" means $0.60. The minimum is "1000000000000" ($0.000001). Up to 8 context tiers can set different input and output rates from a given input size. Rates for each token category:

KindNameRate
inputInputRequired.
outputOutputRequired.
cachedInputCache readFollows the input rate of the request's tier. Listed in reportedUsageKinds, it may also take a rate of its own.
cacheWriteCache writeAlways the input rate of the request's tier: the OpenAI usage format does not itemise cache writes.
reasoningOutputReasoning outputFollows the output rate of the request's tier. Listed in reportedUsageKinds, it may also take a rate of its own.

Reported kinds. List a kind in reportedUsageKinds exactly when your endpoint reports its count with every answer — prompt_tokens_details.cached_tokens and completion_tokens_details.reasoning_tokens on chat completions, input_tokens_details.cached_tokens and output_tokens_details.reasoning_tokens on Responses. A listed kind's count must be present in every report, or that answer goes unpaid; a count of a kind not listed stays inside its side and is billed at the side's rate, exactly as if it were not itemised. Listing a kind keeps it at its side's rate unless you also give it a rate of its own. The quickstart lists none, for an endpoint whose usage carries no cached or reasoning count, or only zeros — choose by what your backend reports.

Changing a price. PUT …/models/:modelId/prices opens a new price version and closes the open one; every price answer lists the resolved rate of each kind below the first tier and at every tier, marked own or follows. A request is billed at the version it was reserved at. A pool keeps serving a new price that stays within the ceilings its owner accepted; a rate above a ceiling stops the model at the tiers it reaches (price_above_ceiling) until the owner raises the ceiling.

Test the connection. POST /v1/supplier/endpoints/:id/validate sends short requests to check each declared operation and capability. All operations must pass before sharing. Failed checks show what to correct; notChecked lists checks left for another run. Each run allows 32 requests within 60 seconds. Wait at least 60 seconds between runs on an endpoint; account limits are 2 runs per minute and 20 per hour. A rate-limit response includes Retry-After. Tests use your endpoint's capacity, not your COMPUTE balance. Changing its URL, auth scheme or credential requires testing again.

Sharing. The pool owner gives you the pool's id. POST /v1/supplier/pools/preview names the pool and its owner before you commit; POST /v1/supplier/endpoints/:id/offers with that poolId offers every live declaration of the endpoint as one pending offer and notifies the owner. Only a private pool takes offers (offer_pool_public), and an endpoint is offered to at most 20 pools at once. A disabled endpoint, one without a model and one with an operation not yet validated are refused, details.reason saying which. If you manage the pool yourself, acceptWithDefaults: true accepts in the same call, each ceiling at your highest rate of its kind.

Withdrawing and removing. DELETE …/offers/:offerId withdraws an offer: the pool owner is notified whether the offer was pending or accepted, and an accepted one's models leave the pool at once. Sharing again reopens it as pending and retains the last owner decision, including its author, date and note. Sharing and withdrawal update the owner's offer notification; owner decisions update the supplier's offer notification. Repeated activity is grouped to limit duplicate alerts and emails. Disabling the endpoint (PATCH with status: "DISABLED") pauses it in every pool, and DELETE removes it for good — the credential is erased, its models retire and its offers are withdrawn. What it already earned is still paid.

Earnings. Billed usage earns your base rate in COMPUTE, within the accepted price limits and request cap. The buyer pays the 5% routing fee in addition. GET /v1/supplier/earnings summarizes earnings by model and pool (30 days by default, up to 90). GET /v1/supplier/earnings/requests lists individual requests and their payment status. Unbilled requests have no earnings and payoutState: null. Billed amounts progress through these states:

Payout stateMeaning
unsettledNo settlement batch has taken it up yet.
in_settlementA settlement batch has taken it up and has not been recorded as paid; a batch held for review stays here until it is resolved.
paidThe batch that took it up has paid it to your wallet.

Set first: $CF_API, $CF_SESSION, $HANDLE, $ALIAS, $UPSTREAM_MODEL, $ENDPOINT_BASE_URL, $ENDPOINT_CREDENTIAL, $POOL_ID.

Supplier — register, connect, declare, validate, share
curl -sS "$CF_API/v1/supplier" \
  -H "Authorization: Bearer $CF_SESSION" |
  jq -e '.standingTerms // halt_error' &&

jq -n --arg HANDLE "$HANDLE" '{ handle: $HANDLE, termsVersion: 2 }' |
  curl -sS -X POST "$CF_API/v1/supplier/handle" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '(.supplier // halt_error).handle' &&

ENDPOINT_ID=$(jq -n \
    --arg ENDPOINT_BASE_URL "$ENDPOINT_BASE_URL" \
    --arg ENDPOINT_CREDENTIAL "$ENDPOINT_CREDENTIAL" \
    '{
      label: "Primary",
      baseUrl: $ENDPOINT_BASE_URL,
      authScheme: "BEARER",
      credential: $ENDPOINT_CREDENTIAL,
      concurrencyLimit: 8,
      rpmLimit: 600,
      tpmLimit: 1000000
    }' |
  curl -sS -X POST "$CF_API/v1/supplier/endpoints" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -er '.id // halt_error') &&

MODEL_ID=$(jq -n \
    --arg ALIAS "$ALIAS" \
    --arg UPSTREAM_MODEL "$UPSTREAM_MODEL" \
    '{
      alias: $ALIAS,
      upstreamModel: $UPSTREAM_MODEL,
      operations: [{ operation: "chat_completions", capabilities: ["tools"] }],
      contextWindow: 131072,
      maxOutputTokens: 8192,
      price: {
        input: "600000000000000000",
        output: "2400000000000000000",
        reportedUsageKinds: []
      }
    }' |
  curl -sS -X POST "$CF_API/v1/supplier/endpoints/$ENDPOINT_ID/models" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -er '.id // halt_error') &&

curl -sS -X POST "$CF_API/v1/supplier/endpoints/$ENDPOINT_ID/validate" \
  -H "Authorization: Bearer $CF_SESSION" |
  jq -e '.results // halt_error' &&

jq -n --arg POOL_ID "$POOL_ID" '{ poolId: $POOL_ID }' |
  curl -sS -X POST "$CF_API/v1/supplier/pools/preview" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '.name // halt_error' &&

OFFER_ID=$(jq -n --arg POOL_ID "$POOL_ID" '{ poolId: $POOL_ID }' |
  curl -sS -X POST "$CF_API/v1/supplier/endpoints/$ENDPOINT_ID/offers" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -er '.id // halt_error')

Set first: $CF_API, $CF_SESSION, $ENDPOINT_ID, $MODEL_ID, $OFFER_ID.

Supplier — last, after the buyer's chains: change the price, withdraw the offer
jq -n '{
    input: "500000000000000000",
    output: "2000000000000000000",
    reportedUsageKinds: []
  }' |
  curl -sS -X PUT "$CF_API/v1/supplier/endpoints/$ENDPOINT_ID/models/$MODEL_ID/prices" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '.id // halt_error' &&

curl -sS -X DELETE "$CF_API/v1/supplier/endpoints/$ENDPOINT_ID/offers/$OFFER_ID" \
  -H "Authorization: Bearer $CF_SESSION" |
  jq -e '.status // halt_error'

Pool owners: admit offers

  1. Create a private pool. Add the people who will use its models and send the Pool ID to your supplier. Membership lets people use models; it does not let them approve suppliers.
  2. Review the offer. Open the pool's offers and check the supplier, models, capabilities and prices. Approve only suppliers you trust with the prompts sent to their models.
  3. Set your price limits and accept. Choose the models and maximum supplier rates you allow, before the routing fee. A price above those limits stops that model from serving the affected requests. You can review new terms or revoke access at any time.
Price limits and pool-owner API examples

Membership is not management. Membership lets an account issue a key into the pool and spend on what the pool admits. Deciding what it admits — accepting, rejecting and revoking offers, and setting ceilings — takes the right to manage the pool: its owner's, and in an organization that of every role the roles table allows to manage pools. Supply stays personal: a supplier offers their own endpoint whatever organization they act in.

A private pool. Only a private pool takes offers. Create one with isPublic: false, add members by the email on their profile, and give suppliers its id. A pool with a pending or accepted offer can be neither made public nor deleted, and removing a member revokes every key they hold in the pool in the same step.

Review an offer. GET /v1/pools/:id/offers shows the supplier, models, capabilities, connection-test results, limits and prices. The endpoint URL and credential stay private. GET /v1/pools/:id/models shows accepted models and buyer prices. Use view=live for pending offers followed by accepted offers, or view=history for closed offers. Both use offset and limit pagination. Without view, the list includes every status. statusCounts gives the pool’s full count for each status, regardless of the current page.

Accept models and prices. The endpoint must be active to accept model terms. A disabled endpoint returns 409 conflict and its offer stays open. An offer without live priced models cannot be accepted. Read the offer at GET /v1/pools/:id/offers/:offerId, then send selected model ids, their current priceVersionId and per-category ceilings to PUT /v1/pools/:id/offers/:offerId/terms. Each ceiling must cover that category's highest current rate across all tiers. The app defaults to those rates; the example below accepts every live model. A pool supports up to 20 accepted offers. Price-limit fields:

CeilingName
inputInput
outputOutput
cachedInputCache read
reasoningOutputReasoning output

Changing price limits. To change ceilings or the selected models, send the complete model list to the same PUT route, using each current priceVersionId. A stale price returns 409 offer_changed; reload and review the offer before accepting again. The example below accepts all current rates, including increases: edit $TERMS first to retain your own ceilings.

Revoking and rejecting. An empty list, or DELETE …/terms, revokes an accepted offer: its models leave the pool at once. POST …/reject declines a pending one, whose models never served the pool. The supplier is notified of either.

Set first: $CF_API, $CF_SESSION, $MEMBER_EMAIL.

Pool owner — create the pool, add a member
POOL_ID=$(jq -n '{ name: "Research", isPublic: false }' |
  curl -sS -X POST "$CF_API/v1/pools" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -er '.id // halt_error') &&

jq -n --arg MEMBER_EMAIL "$MEMBER_EMAIL" '{ email: $MEMBER_EMAIL }' |
  curl -sS -X POST "$CF_API/v1/pools/$POOL_ID/members" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '.id // halt_error'

Set first: $CF_API, $CF_SESSION, $POOL_ID, $OFFER_ID.

Pool owner — accept every live model of an offer at its rates
TERMS=$(curl -sS "$CF_API/v1/pools/$POOL_ID/offers/$OFFER_ID" \
  -H "Authorization: Bearer $CF_SESSION" |
  jq -ec '[
    (.models // halt_error)[] | select(.retired == false) | {
      endpointModelId: .endpointModelId,
      priceVersionId: .price.id,
      ceilings: {
        input: ([.price.rates.input.usd18PerM, .price.tiers[].rates.input.usd18PerM] | max_by([length, .])),
        output: ([.price.rates.output.usd18PerM, .price.tiers[].rates.output.usd18PerM] | max_by([length, .])),
        cachedInput: ([.price.rates.cachedInput.usd18PerM, .price.tiers[].rates.cachedInput.usd18PerM] | max_by([length, .])),
        reasoningOutput: ([.price.rates.reasoningOutput.usd18PerM, .price.tiers[].rates.reasoningOutput.usd18PerM] | max_by([length, .]))
      }
    }
  ]') &&

jq -n --argjson TERMS "$TERMS" '{ models: $TERMS }' |
  curl -sS -X PUT "$CF_API/v1/pools/$POOL_ID/offers/$OFFER_ID/terms" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '.status // halt_error'

Buyers: call a private model

  1. Join the pool. Ask its owner to add you. Create an API key for that pool and make sure the paying account has enough COMPUTE.
  2. Choose an available model. Open the pool's models, or call GET /v1/models with your key. Use its full handle/alias id and check that it supports the operations and tools your app needs.
  3. Connect your app. Use your pool key with the Inference API, or follow the Codex setup below. Your supplier's credential is not needed.
Model discovery, request examples and troubleshooting

A key in the pool. Issue a key with the pool's id as poolId; a key's pool is fixed for its life. Only the pool's owner and members can — anyone else gets 404 not_found, the answer for a pool that does not exist. Removing a member revokes every key they hold in the pool, so their next request answers 401 api_key_revoked, and adding them back restores none: they issue a new key.

Find a model with your pool key. GET /v1/models includes the public catalogue and your pool's accepted private models. For a private model, check its id (handle/alias), operations, admittedInputTokens and maxOutputTokens. pricing.buyer is USD per million tokens including the routing fee; pricing: null means no price is accepted. eligibleUpToInputTokens is null if price ceilings impose no input-size bound, 0 if no size is admitted, or the largest reserved input size allowed by the ceilings. Model context limits and each operation's availability still apply. Availability checks and cost estimates use the same key and pool.

Calling one. Name it as model on /v1/chat/completions, /v1/messages or /v1/responses. The answer's model and X-Model-Used carry the handle/alias, and X-Provider the handle. A bare model name is always a catalogue model, never an alias, and auto chooses among catalogue models only. A private model never falls back on its own: a request reaches another model only through a models[] list that names it — on /v1/chat/completions and /v1/messages; /v1/responses serves exactly the model it names — and a catalogue model in that list is served by the catalogue capacity the pool reaches — the provider keys its owner and members deposited — so every fallback is one you wrote.

Set first: $CF_API, $CF_SESSION, $POOL_ID.

Buyer — a key in the pool
CF_API_KEY=$(jq -n --arg POOL_ID "$POOL_ID" '{ label: "codex", poolId: $POOL_ID }' |
  curl -sS -X POST "$CF_API/v1/keys/create" \
    -H "Authorization: Bearer $CF_SESSION" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -er '.rawKey // halt_error')

Set first: $CF_API, $CF_API_KEY, $MODEL.

Buyer — the pool's model in GET /v1/models
curl -sS "$CF_API/v1/models" \
  -H "Authorization: Bearer $CF_API_KEY" |
  jq -e --arg MODEL "$MODEL" '[(.data // halt_error)[] | select(.id == $MODEL)]'

A tool-using turn. The exchange keeps no conversation, so every request carries the whole history. The first call below declares a tool, names it in tool_choice and sets parallel_tool_calls: false, so the model returns exactly one function_call, which the chain keeps — it stops, printing the calls, on none or several; the second sends the history with that call and a function_call_output under its call_id, and gets the answer. On /v1/chat/completions the same turn is an assistant message with tool_calls followed by a tool message.

Set first: $CF_API, $CF_API_KEY, $MODEL.

Buyer — a tool-using turn on /v1/responses
CALL=$(jq -n --arg MODEL "$MODEL" '{
    model: $MODEL,
    input: [
      {
        type: "message",
        role: "user",
        content: "What is the weather in Paris? Use the tool."
      }
    ],
    tools: [
      {
        type: "function",
        name: "get_weather",
        description: "Current weather for a city",
        parameters: {
          type: "object",
          properties: { city: { type: "string" } },
          required: ["city"],
          additionalProperties: false
        }
      }
    ],
    tool_choice: { type: "function", name: "get_weather" },
    parallel_tool_calls: false
  }' |
  curl -sS -X POST "$CF_API/v1/responses" \
    -H "Authorization: Bearer $CF_API_KEY" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -ec '[(.output // halt_error)[] | select(.type == "function_call")] | if length == 1 then .[0] else halt_error end') &&

jq -n \
    --arg MODEL "$MODEL" \
    --argjson CALL "$CALL" \
    '{
      model: $MODEL,
      input: [
        {
          type: "message",
          role: "user",
          content: "What is the weather in Paris? Use the tool."
        },
        $CALL,
        {
          type: "function_call_output",
          call_id: $CALL.call_id,
          output: "{\"temperature_c\":18,\"sky\":\"clear\"}"
        }
      ],
      tools: [
        {
          type: "function",
          name: "get_weather",
          description: "Current weather for a city",
          parameters: {
            type: "object",
            properties: { city: { type: "string" } },
            required: ["city"],
            additionalProperties: false
          }
        }
      ]
    }' |
  curl -sS -X POST "$CF_API/v1/responses" \
    -H "Authorization: Bearer $CF_API_KEY" \
    -H "Content-Type: application/json" \
    -d @- |
  jq -e '.output // halt_error'

A model outside your pool. GET /v1/models omits it, and calling it answers 422 validation_failed with Unknown vendor "$HANDLE" in "$MODEL" — exactly what a model that does not exist gets, so no answer reveals another pool's supply. A key issued in another pool answers this way, as do a model of an offer the pool never accepted, one declared after the pool's last acceptance ended, and one retired before that acceptance began. A model declared before an accepted offer closed, and a changed model waiting for acceptance, stay listed and answer 422 offer_unavailable with details.reason. Check the key's pool before the handle.

When a model cannot serve. availability on GET /v1/models and on the pool's offers, and details.reason of 422 offer_unavailable, take these values. A model's own availability reads available only while every operation it declares can serve; otherwise read operations[].availability for the operation you call, which serves while it reads available. details.actor names who has to act first:

ValueMeaningWho acts
availableAvailable—
awaiting_acceptanceAwaiting pool approvalPool owner
price_above_ceilingPrice exceeds pool limitPool owner
endpoint_disabledEndpoint disabledSupplier
endpoint_removedEndpoint removedNobody — a removed endpoint never serves again
model_retiredModel retiredSupplier
offer_closedOffer closedSupplier
validation_failedConnection check not passedSupplier
cooldownTemporarily paused after errorsSupplier

For offer_unavailable, check details.reason and details.actor. Closed offers need a new agreement; changed models need pool-owner acceptance. For rate_limited, details.scope identifies an endpoint or pool limit. Unsupported operations or history need a request change; history_unavailable requires the original model and endpoint or a new conversation. See Errors for the full reference.

Codex

Codex CLI 0.166.0 uses a compatible private model over /v1/responses. Put this provider setup in ~/.codex/config.toml, replace the example model id with yours from GET /v1/models, and set the input window as described below. Export the key as CF_API_KEY before running codex:

~/.codex/config.toml
model_provider = "compute"
model = "<handle>/<alias>"
web_search = "disabled"

[model_providers.compute]
name = "Compute Finance"
base_url = "https://api.compute.finance/v1"
env_key = "CF_API_KEY"
wire_api = "responses"
  • model names the model by its handle/alias id. auto is refused on /v1/responses, and a bare name is a catalogue model.
  • The provider's name is anything but OpenAI, which switches Codex to behaviour only OpenAI's own API supports; wire_api = "responses" is the only wire Codex speaks.
  • web_search = "disabled": by default Codex adds a hosted web-search tool, which the exchange does not run and refuses (operation_unsupported).
  • Before running Codex, read the selected model from GET /v1/models using your API key. Add model_context_window at the top level of config.toml, before [model_providers.compute], and set its integer value to the private model's admittedInputTokens. For a catalogue model, use its published maxInputTokens, or the backend's verified input limit if none is published. Update this value when changing models. Codex compacts at 90% of its selected window; use /compact to reduce a conversation that reaches context_length_exceeded.
Model compatibility and client behavior
  • This provider setup does not automatically enable tool search in Codex. Use tool search with a client that sends tool_search with execution: "client" and handles discovery results. The request and continuation steps are under Responses API.
  • Leave model_reasoning_effort unset, or set it to none, which every model accepts; any other effort needs a model whose operation declares reasoning, and on a model served over chat completions is one of none, low, medium, high.
  • For a private handle/alias without matching Codex model metadata, Codex edits files through the shell. To use apply_patch, provide matching Codex metadata that enables it and choose a model whose serving operation lists the tool’s format in customToolFormats from GET /v1/models, including its grammar when required. Models served through Chat Completions do not return reasoning. Supported tools and inputs are listed under Responses API.
  • A session that replayed reasoning a natively served model produced continues only on that model and its endpoint: any other model or endpoint answers history_unavailable. Start a new session to switch.
  • /compact and /review use billable inference requests. Review uses review_model if set, otherwise model.
  • Codex resends retryable requests with the retained conversation history, up to stream_max_retries (5 by default). This includes a mid-stream response.failed carrying stream_interrupted. A tool call may already have run locally before the interruption; another call produced after a resend can repeat its effects. Check local changes before manually retrying a failed task. Each resend is a separate inference request subject to the normal reservation and usage-billing rules. An output-limit response.incomplete stops the request rather than triggering this retry loop, so choose a model whose maxOutputTokens fits your tasks.
  • Leave supports_websockets unset. Use HTTP; the exchange does not support WebSocket inference.

History, retries and privacy

  • Send the history with each turn. The exchange does not store conversations. previous_response_id, store: true and item_reference are unsupported. Requests to the supplier use store: false.
  • Switching models. Messages and tool results can move between models. Encrypted reasoning can only continue on the model and endpoint that created it; otherwise the API returns history_unavailable. Start a new conversation to switch.
  • Interrupted responses. Compute Finance can retry before the first output, but never after text or a tool call reaches the client. A stream that ends too early returns stream_interrupted. An output-limit response (finish_reason: "length" or response.incomplete) stops normally at that limit. Your client may make a new request after an interruption; check completed tool actions before retrying. See Codex for its automatic resend behavior.
  • Supplier privacy. The supplier receives the prompts sent to its models. Compute Finance checks compatibility and usage reports, but does not independently verify model identity or the supplier's data practices. Choose a supplier you trust.

Pricing and payments

  • Prices in USD, payment in COMPUTE. The supplier's price and the USD-to-COMPUTE conversion rate are fixed for each request. Changes during the request do not change its bill.
  • Routing fee: 5%. Prices shown to buyers already include the fee. Suppliers earn their base rate.
  • Maximum charge. Before sending your request, Compute Finance reserves enough for the most expensive permitted route, including the routing fee. The final charge cannot exceed the serving model's reserved cap. Set an output limit to control how much a request can spend.
  • Pool price limits. A model can serve only at rates within the limits accepted by the pool owner. The routing fee is added to those supplier rates.

You pay for valid usage the supplier reports; unused reserved funds return to your balance.

Billing outcomes and request receipts

Usage bounds. Each reported count is a whole number no greater than 2,147,483,647, and input and output together stay within that limit. The input may be at most 1.1 × the model's context window, and the output at most 1.1 × the request's output limit.

Incomplete or invalid usage. Missing, inconsistent or out-of-bounds usage is not estimated or billed. The reservation is released and the supplier sees the reason in earnings. Valid usage received before a stream interruption can be billed; stopping a client does not guarantee that the upstream request stops. For non-streaming responses, X-Compute-Used is the final charge. Chat streams send this header before completion as the reserved amount; use final x_credits_used for the settled charge. Responses streams report usage on their terminal event, with usage: null when unbilled. An interrupted stream ends with stream_interrupted rather than a settled final result. The earnings record shows one of these outcomes:

OutcomeMeaning
BILLEDBilled
BILLED_AT_CAPBilled at the request limit
UNBILLED_METERING_ERRORNot billed: invalid usage report
UNBILLED_INTERRUPTEDNot billed: interrupted before usage arrived

For help with a request, keep its X-Request-Id. Never send a credential or prompt to support. Buyers see billed usage; suppliers also see unpaid requests and the reasons they were not billed.

Integration contracts

How a model is named and chosen, which API answers which question, and what a request costs in $COMPUTE — the rules the running system enforces, in one place. The wire-format detail behind each stays in the section it belongs to.

Model identifiers and selection

The identifier. GET /v1/models publishes the routable catalogue in OpenAI format, and every id has the form vendor/model — the identifier the Inference API routes and bills on. Pass it as model, or as an entry of the models[] fallback list. The bare model name is accepted in both places, so x-ai/grok-4.5 and grok-4.5 reach the same model; the match is case-insensitive, and an unknown vendor prefix, or a real model named under the wrong vendor, is rejected rather than resolved by guess. GET /v1/oracle/resolve/{key} answers what a spelling resolves to before you send it.

A supplier's model. Under a key issued into a private pool, GET /v1/models also lists the models that pool admits from suppliers, each as handle/alias — the supplier's handle, then the model's alias. Such an id resolves only under a key of that pool and answers anyone else as an unknown model, and a bare name never resolves to one; see Private endpoints.

auto. Omitting model, or setting it to auto, hands the choice to the exchange: it serves a model from the operator's ordered preference list, among the entries with serving capacity — send conversation_id to group the turns of one conversation, so the exchange keeps serving them from the same capacity. When that list is empty, or nothing on it can serve, the choice falls through to the cheapest model that can rather than refusing every buyer over an operator setting; a list that can serve nothing also raises an operator alert. That value is a routing directive and never a catalogue id — it takes no vendor prefix and may not appear inside models[]. When no model has capacity the request is refused with 503 rather than served by something you did not choose, and GET /v1/models/availability names the model auto resolves to from that list right now.

routing_bias. An optional cheaper / balanced / better, defaulting to balanced, that leans an auto choice toward the cheaper or the stronger end of the operator's list. It is a bias and not a service level — it influences which model is picked and promises neither a price nor a quality. Sending it beside a named model, or beside a models[] list, is refused with 422 validation_failed: both spend the choice the dial exists to lean. It reaches that choice only where the exchange made one for the request, which X-Model-Chooser names — engine and pin carry the bias, while list and degraded mean the operator's order served and the dial did not act. Changing the value releases the model a conversation_id was being served from, so the next turn is chosen afresh. GET /v1/inference/estimate takes the same dial and runs the same choice, so a quote can be leaned exactly as the request it stands for.

Your own fallback list. Send models — an ordered list of 1 to 8 model ids — catalogue ids and, under a key of a private pool, its handle/alias ids; model, when present, is tried first, then each entry in turn. An entry lacking capacity or a requested capability is skipped, the request is billed at the model that answered, and the hold covers the costliest listed entry with the excess released at settlement. Combining a list with model: auto is rejected. Fall-through covers capacity and capability only: a prompt above an entry's context window, or a parameter that entry rejects as invalid, aborts the request instead of moving to the next candidate.

No silent substitution. A named model is served or the request fails — the exchange never swaps it for another. Substitution happens only where you asked for it: an entry of your models[] list, or auto. Every answer says which model produced it — X-Model-Used names the model that ran, X-Model-Requested the one the exchange set out to serve, and X-Fallback-Used reads true exactly when the two differ. A named model outside a key's allowedModels is refused with 403 model_restricted rather than swapped for one the key may reach.

Parameters. What each wire format does with every parameter it is sent — take it, refuse it, or drop it under a published policy — is listed under Wire-format deltas.

Which API answers what

Two products share one host. The Inference API is paid, takes a ct_live_* key, and serves the models that can run a request. The Oracle API is free, unauthenticated and read-only, and publishes prices and the index over a catalogue that is a superset of the routable set — a model can be priced there and not be routable here.

QuestionAsk
Which models may I name?GET /v1/models
Which of them can serve right now?GET /v1/models/availability
What does this spelling resolve to?GET /v1/oracle/resolve/{key} · GET /v1/oracle/resolve?keys={csv}
What will this request cost?GET /v1/inference/estimate
What rates am I billed at?GET /v1/oracle/pricing
What do the vendors charge?GET /v1/oracle/models · GET /v1/oracle/catalog
What is compute worth, now and over time?GET /v1/oracle/scu · GET /v1/oracle/history
What have I spent, and what is left?GET /v1/usage

Markup is where the two price lists differ. Every figure on GET /v1/oracle/pricing already carries the routing markup, cache and reasoning components included, so it matches what a request is charged. GET /v1/oracle/models and GET /v1/oracle/catalog publish the vendors' own list prices without it, and /v1/oracle/models and /v1/oracle/basket carry the marked-up pair alongside as markedUpUsdPricePerMillion and markedUpWeiPricePerMillion. Read a number against the endpoint it came from; the two lists are not interchangeable.

What a request costs

Tokens are split by kind, and the kind picks the rate. The catalogue prices each kind separately on the models that support it; a kind a model does not price separately is billed at its side's rate — cache components at input, reasoning output at output.

KindCounts
inputPrompt tokens the provider read fresh.
outputTokens the model generated, thinking tokens included.
cachedInputPrompt tokens served from a cache hit.
cacheWrite5mPrompt tokens written into a 5-minute cache entry.
cacheWrite1hPrompt tokens written into a 1-hour cache entry.
reasoningOutputThinking tokens, on a model that prices them apart from ordinary output.

The arithmetic. Each kind's token count is charged at its own rate per million tokens. On a model with a context-tier ladder, the whole input side of the request — prompt plus cache reads plus cache writes — picks the tier the input and output rates are read from. The legs are summed, the 5% routing markup is applied to that sum exactly once, and the result is divided by the $COMPUTE peg to reach the debit. Settlement re-runs the same arithmetic on the token counts the provider reported, and that is the bill; the reservation only decides how much was held.

The provenance mark a catalogue price carries plays no part in this arithmetic — Endpoints defines what it records.

1000 prompt tokens, 500 completion tokens, openai/gpt-5.5
# Catalogue rates for openai/gpt-5.5 — GET /v1/oracle/catalog
input    $5.00 per 1M tokens
output  $30.00 per 1M tokens

# Peg — GET /v1/oracle/pricing
pegUsd  73.733841 USDC per 1 $COMPUTE

input leg     1000 / 1e6 x  5.00  = $0.005
output leg     500 / 1e6 x 30.00  = $0.015
subtotal                          = $0.020
routing markup             x 1.05 = $0.021
÷ peg                / 73.733841  = 0.00028480816562913085 $COMPUTE

# GET /v1/inference/estimate?model=openai/gpt-5.5&promptTokens=1000&completionTokens=500
{
  "model": "openai/gpt-5.5",
  "resolvedModel": "openai/gpt-5.5",
  "promptTokens": 1000,
  "completionTokens": 500,
  "creditsCost": 0.00028480816562913085,
  "creditsWei": "284808165629131",
  "usdCost": 0.020999999999999998,
  "reservedWei": "284808165629131",
  "tierFromInputTokens": null
}

Catalogue prices and the peg both move, so the figures above are illustrative — GET /v1/inference/estimate is the quote that is always current, and its reservedWei is the hold the charge comes out of.

Model Context Protocol (MCP)

AI agents can query the oracle, estimate costs and analyze local Claude Code sessions through the official Compute Finance MCP server — stdio transport, no API key and no account required. Every tool here is free: none of them sends an inference request. Connect your account and the same server answers for it too.

Claude Code — one command registers the server, its slash skills and a hook that reports what each session cost:

npx @compute-finance/mcp setup

Any other MCP client — add the server to the client's own configuration:

{"command":"npx","args":["@compute-finance/mcp"]}

Every tool carries one of these prefixes:

PrefixWhat it answersWhat it needs
data_get_*Live oracle data — SCU and CPI, basket, catalogue, model prices and their history, reconstitutions, methodology, model availabilityNothing
compute_*Cost estimation and cross-model comparisonNothing
render_*Pre-formatted session reports — what the slash skills printThis machine
analyze_*Raw JSON session and per-inference breakdownThis machine
telemetry_get_*Aggregate stats across logged sessionsThis machine
account_*Read access: balance, spend, keys and history. Act access: create an API key, freeze or unfreeze a key, set budget caps, configure auto top-upA connected account

The local tools read your Claude Code transcripts and session logs on this machine, price them at live oracle rates and upload nothing. The account_* tools are registered only once an account is connected, and only the ones its grant allows.

Bundled Claude Code slash skills:

  • /cf-session-management — Measured post-session cost analysis
  • /cf-session-consumption — Per-inference token spend breakdown
  • /cf-active-sessions — Multi-session overview across projects
  • /cf-account — Spend, live keys and cap headroom of the connected account

Connect your account

  1. Open Settings → Connected apps and press Grant access. Name the app and tick Read, Act or both; in an organization, pick the account the grant is pinned to. Copy the cfa_live_… token — it is shown once.
  2. Store the token on the machine that runs the client, pasting it when asked:
    npx @compute-finance/mcp setup --account
    Typing is hidden and the token is never a command argument. It is kept in your operating system's secret store (macOS Keychain, Windows DPAPI, Linux Secret Service).
  3. Restart the MCP client — the account_* tools the grant allows do not appear until you do.

Act access changes the account. An app holding it can create an API key that spends the balance, freeze or unfreeze a key, change or clear the budget caps, and configure auto top-up, which charges your saved card and is always set on your own personal account, even when the grant is pinned to an organization. No grant can take money out of the account: withdrawals, transfers and anything that needs a wallet signature stay with your wallet.

To keep the token in a password manager instead, set CF_APP_GRANT_COMMAND to a command that prints it:

op read op://Private/compute-finance/token

The server runs it at startup, before looking in the OS secret store.

Revoke the grant in Settings → Connected apps, then remove the stored token:

npx @compute-finance/mcp setup --forget-account

A frozen grant can be unfrozen there, so keep the stored token while it is only frozen. Either way the public and local tools keep working.

Reference: github.com/compute-finance/mcp · /.well-known/mcp/server-card.json

The CPI is a public benchmark, not financial advice. Data is sourced from public provider pricing pages, may not reflect negotiated enterprise rates, and does not constitute an offer of any token or security. Compute Finance is independent and not affiliated with any of the providers whose public pricing is tracked in the index.

Read the full disclaimer →

Have a question about the index, the basket, or the methodology?

Ask AI about compute.finance

AI compute, priced.

The public reference price for AI compute.