[Vision](https://compute.finance) | [Oracle](https://oracle.compute.finance) | [Documentation](https://docs.compute.finance) --- # Compute Finance -- Documentation API reference, guides, and integration documentation for Compute Finance. --- ## Early Access Compute Finance is in early access. The CPI Oracle and public API are live. Register a Compute Finance ID to join the waitlist. [REQUEST ACCESS](https://compute.finance/login) --- ## 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 weighted reference price -- the Standard Compute Unit ("SCU") -- calculated from a basket of models across major providers. ### The Problem LLM inference pricing is fragmented. Every provider quotes pricing differently -- per token, per character, per request, per tier. 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 a weighted basket of AI models across major providers (OpenAI, Anthropic, Google, xAI) that produces a single, verifiable unit of account: the Standard Compute Unit (SCU). The SCU represents the USD cost of a fixed reference workload (token counts published via the API) averaged across the full basket. ### Key Properties - **Verifiable** -- All prices are published on-chain via the OracleRegistry contract on Base. Anyone can independently verify the basket composition and pricing. - **Diversified** -- Basket models across major providers prevent any single provider from dominating the index. - **Outlier-resistant** -- A per-tier 2x cap on individual model costs prevents one expensive model from distorting the tier average. - **Versioned** -- Current basket: v1.0 (launched April 7, 2026). The index has tracked AI compute pricing since June 17, 2025 under basket v0. Every reconstitution is recorded on-chain. - **Open methodology** -- The formula is deterministic and reproducible from public provider pricing. --- ## Basket Composition The CPI tracks models from major providers, organized into three tiers. One model per provider per tier. The basket is reviewed quarterly and updated with a new version number when models are added, removed, or replaced. [Live data: GET https://api.compute.finance/v1/oracle/basket] ### Frontier Highest-capability models. Best reasoning, longest context, most accurate. [Live data: GET https://api.compute.finance/v1/oracle/basket -- frontier tier models] ### Standard Balanced cost-performance models. General-purpose workhorses. [Live data: GET https://api.compute.finance/v1/oracle/basket -- standard tier models] ### Lightweight Fastest, cheapest models. For high-volume, latency-sensitive tasks. [Live data: GET https://api.compute.finance/v1/oracle/basket -- lightweight tier models] Tier weights reflect real-world usage distribution across capability tiers. Current weights are published via `GET https://api.compute.finance/v1/oracle/tiers`. --- ## SCU Formula The Standard Compute Unit is calculated in three steps. The reference workload is a fixed token count (published in the `referenceWorkload` field of `GET https://api.compute.finance/v1/oracle/scu`), evaluated across all basket models. ### Step 1 -- Per-Model Cost For each model in the basket, compute the USD cost of the reference workload using the provider's published per-token pricing. ``` cost_m = (input_price_m x input_tokens) + (output_price_m x output_tokens) ``` ### Step 2 -- Per-Tier Capped Mean Within each tier, compute the mean cost. Any model whose cost exceeds 2x the tier mean is capped at 2x the mean. This prevents a single expensive model from distorting the tier average. ``` tier_avg_t = mean(min(cost_m, 2 x tier_mean_t)) ``` ### Step 3 -- Weighted Sum Apply tier weights and sum. Current weights are published via `GET https://api.compute.finance/v1/oracle/tiers`. ``` SCU = (frontier_avg x frontier_weight) + (standard_avg x standard_weight) + (lightweight_avg x lightweight_weight) ``` ### Live Tier Breakdown [Live data: GET https://api.compute.finance/v1/oracle/tiers] | Tier | Weight | Capped Mean | Contribution | |---|---|---|---| | Frontier | [Live data: weight from /v1/oracle/tiers] | [Live data] | [Live data] | | Standard | [Live data: weight from /v1/oracle/tiers] | [Live data] | [Live data] | | Lightweight | [Live data: weight from /v1/oracle/tiers] | [Live data] | [Live data] | | **Total SCU** | | | **[Live data: GET https://api.compute.finance/v1/oracle/scu]** | Anyone with access to provider pricing pages can independently reproduce this number. --- ## Basket Rules The CPI basket is governed by rules that enforce stability, fairness, and verifiability. Changes are tracked via version numbers and recorded on-chain. ### Quarterly Reviews The basket is reviewed every quarter. During each review, model pricing is updated, tier assignments are reviewed, and models are added or removed as needed. Each review produces a new basket version. ### Addition Criteria - Model must be generally available via a public API for at least 30 days - Provider must publish verifiable per-token pricing - Model must fit one of the three tiers (Frontier, Standard, Lightweight) - Each tier targets one model per provider ### Removal Criteria - Model is deprecated or end-of-lifed by the provider - Model is superseded by a newer version from the same provider in the same tier - Provider discontinues verifiable pricing or public API access ### Emergency Triggers An emergency reconstitution is triggered if any model with >=25% effective weight in its tier changes price by >=30% within a single day. Emergency updates are published within 24 hours and increment the basket version. ### Version Tracking Every basket change is published as a new on-chain version. The full history is available via the `GET https://api.compute.finance/v1/oracle/reconstitutions` endpoint and exportable as CSV. On-chain, the OracleRegistry contract records each version with a timestamp. **v0 vs v1.0.** The CPI was first deployed on June 17, 2025 as basket v0 -- an internal version used to validate the methodology, build pricing history, and refine basket composition. v1.0 is the public launch basket as of April 7, 2026. The v0 to v1.0 transition carries forward all historical data: anyone querying the API can read the full pricing history back to inception. **Version numbering.** The API's `basketVersion` and `latestRevisionVersion` fields return the on-chain revision counter -- a monotonically incrementing integer (currently in the 40s). This is NOT the same as the marketing version ("v1.0"). The mapping is: v0 = revisions 1-39 (internal testing), v1.0 = revision 40+ (public launch). Each API response that includes `basketVersion` reflects the on-chain revision number, not the marketing version. --- ## 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, read functions, ethers.js examples, and Basescan verification instructions are maintained at the oracle subdomain: https://oracle.compute.finance/llms-full.txt#on-chain-verification --- ## Public API All oracle endpoints are public and require no authentication. Read access is free and unrestricted. Base URL: `https://api.compute.finance` ### OpenAPI specification The public API contract is published as an OpenAPI 3.x document — auto-generated from the live NestJS controllers, so the spec and the running server cannot drift. Use it to generate typed clients in any language with `openapi-generator`, `openapi-typescript`, `oapi-codegen`, or any other OpenAPI-driven codegen. | URL | Format | Notes | |---|---|---| | `https://api.compute.finance/v1/openapi.yaml` | YAML | Canonical | | `https://api.compute.finance/v1/openapi.json` | JSON | Same spec, JSON encoding | | `https://api.compute.finance/openapi.yaml` | YAML | Conventional alias for agents probing root | | `https://api.compute.finance/openapi.json` | JSON | Conventional alias | | `https://api.compute.finance/openapi` | HTML | Swagger UI for interactive exploration | | `https://api.compute.finance/v1/docs` | HTML | Same Swagger UI, versioned path | All alias URLs return the same byte-identical body — there is exactly one public spec. Public-spec resource endpoints emit a `Link: ; rel="service-desc"; type="text/yaml"` HTTP header (RFC 8631) pointing at the canonical spec. The spec endpoints themselves are reachable cross-origin (`Access-Control-Allow-Origin: *`) so browser-based agents can fetch directly. Cache control: `public, max-age=300, must-revalidate` with weak ETags from Express defaults — refetch hourly to pick up new endpoints when the API ships. **Scope.** The public spec covers read-only Oracle (`/v1/oracle/*`) and Market (`/v1/market/*`, `/v1/pricing`) endpoints — fourteen routes total. Auth-gated surfaces (account, keys, treasury, inference, dashboard, admin, ...) are intentionally excluded. They require wallet signatures or `ct_live_*` Bearer tokens and have a stricter compatibility surface; agents generating clients off the public spec cannot accidentally call them. **Discovery.** The OpenAPI URL is also referenced from `llms.txt` and `llms-full.txt` on `compute.finance`, `oracle.compute.finance`, and `docs.compute.finance`, listed once in the docs sitemap, and advertised in the HTML `` of all three UIs as ``. Agents probing any of these surfaces should reach the spec without guessing paths. ### Rate limits The public oracle API is rate-limited to **120 requests per minute per IP** (burst 120). A short-term cap of 5 requests per second and a medium-term cap of 20 requests per 10 seconds also apply to protect the backend. Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers (from the NestJS Throttler). Clients that exceed the limit receive a `429 Too Many Requests` response with a `Retry-After` header. Data updates hourly, so polling more often than once per minute is not useful. **`/v1/points`** — the points and achievements API requires CF ID JWT authentication and is not yet part of the public API surface. It will be documented when publicly available. ### V1 scope -- what is not shipping V1 does not ship a first-party typed SDK -- use the OpenAPI spec at `https://api.compute.finance/v1/openapi.yaml` to generate clients with `openapi-generator`, `openapi-typescript`, or `oapi-codegen`. ### Compute Finance MCP The official Compute Finance MCP is published at [github.com/compute-finance/compute-finance-mcp](https://github.com/compute-finance/compute-finance-mcp) and on npm. It ships ten Model Context Protocol tools across oracle data, session-cost math, and local history -- the canonical way for AI agents to query Compute Finance. --- ## Endpoints | Method | Path | Description | |---|---|---| | GET | `https://api.compute.finance/v1/oracle/scu` | Current SCU value, tier breakdown, basket version | | GET | `https://api.compute.finance/v1/oracle/models` | All basket models with tier, provider, and pricing | | GET | `https://api.compute.finance/v1/oracle/model/:key` | Single model by pricing key | | GET | `https://api.compute.finance/v1/oracle/tiers` | Tier definitions, weights, and current model assignments | | GET | `https://api.compute.finance/v1/oracle/basket` | Full basket composition including all models, tiers, weights | | GET | `https://api.compute.finance/v1/oracle/history?range=30d` | Hourly SCU history. Range: 30d, 90d, 1y, all | | GET | `https://api.compute.finance/v1/oracle/reconstitutions` | History of basket reconstitutions with version, models, SCU delta | | GET | `https://api.compute.finance/v1/oracle/health` | Latest version number and confirmation timestamp | **`/v1/oracle/models` vs `/v1/oracle/basket`**: The `/models` endpoint returns only the array of basket models with their pricing. The `/basket` endpoint returns the same models array PLUS basket-level metadata: current SCU breakdown, SCU value in USD, routing fee rate, basket version, and last-updated timestamp. --- ## Code Examples All endpoints are public. No authentication required. ### Get Current SCU **cURL** ```bash curl https://api.compute.finance/v1/oracle/scu ``` **Python** ```python import requests resp = requests.get("https://api.compute.finance/v1/oracle/scu") data = resp.json() print(f"SCU: {data['scuUsd']}") ``` **TypeScript** ```typescript const resp = await fetch("https://api.compute.finance/v1/oracle/scu"); const data = await resp.json(); console.log(`SCU: ${data.scuUsd}`); ``` ### List All Models **cURL** ```bash curl https://api.compute.finance/v1/oracle/models ``` **Python** ```python import requests resp = requests.get("https://api.compute.finance/v1/oracle/models") data = resp.json() for model in data["models"]: print(f"{model['displayName']} ({model['tier']})") ``` **TypeScript** ```typescript const resp = await fetch("https://api.compute.finance/v1/oracle/models"); const data = await resp.json(); for (const model of data.models) { console.log(`${model.displayName} (${model.tier})`); } ``` ### Get Single Model **cURL** ```bash curl https://api.compute.finance/v1/oracle/model/claude-opus-4.7 ``` **Python** ```python import requests resp = requests.get("https://api.compute.finance/v1/oracle/model/claude-opus-4.7") model = resp.json() print(f"{model['displayName']}: ${model['usdPricePerMillion']['input']}/1M input") ``` **TypeScript** ```typescript const resp = await fetch("https://api.compute.finance/v1/oracle/model/claude-opus-4.7"); const model = await resp.json(); console.log(`${model.displayName}: $${model.usdPricePerMillion.input}/1M input`); ``` ### Historical SCU (30 days) **cURL** ```bash curl "https://api.compute.finance/v1/oracle/history?range=30d" ``` **Python** ```python import requests resp = requests.get("https://api.compute.finance/v1/oracle/history", params={"range": "30d"}) data = resp.json() for snap in data["data"]: print(f"{snap['date']}: SCU={snap['scu']}") ``` **TypeScript** ```typescript const resp = await fetch(`https://api.compute.finance/v1/oracle/history?range=30d`); const data = await resp.json(); for (const snap of data.data) { console.log(`${snap.date}: SCU=${snap.scu}`); } ``` --- ## Response Schemas ### `GET https://api.compute.finance/v1/oracle/scu` The live SCU value and per-tier breakdown. The example values below are illustrative -- fetch the live endpoint for current numbers. The `breakdown` object is already tier-weighted (each value is `capped_mean x weight`); summing the three entries yields `scuUsd`. ```json { "scuUsd": 0.006494986, "breakdown": { "frontier": 0.003449676375, "standard": 0.00250519, "lightweight": 0.000540119625 }, "referenceWorkload": { "inputTokens": 1000, "outputTokens": 500 }, "methodology": "Capped equal-weight across 3 tiers (frontier 30%, standard 40%, lightweight 30%)", "updatedAt": "2026-04-21T13:54:38.820Z" } ``` ### `GET https://api.compute.finance/v1/oracle/models` The full list of basket models. The response is a top-level `models` array; each entry carries the model identity, tier, integration status, and both raw and marked-up per-million pricing in $COMPUTE and USD. Example values are illustrative. ```json { "models": [ { "id": "gpt-5.4", "displayName": "GPT-5.4", "provider": { "key": "openai", "name": "OpenAI" }, "tier": "frontier", "integrated": true, "ctPricePerMillion": { "input": 378, "output": 2269 }, "usdPricePerMillion": { "input": 2.49858, "output": 14.99809 }, "markedUpCtPricePerMillion": { "input": 396.9, "output": 2382.45 }, "markedUpUsdPricePerMillion": { "input": 2.623509, "output": 15.747995 }, "oracleKeyPrefix": "gpt-5.4" } ] } ``` **Field: `integrated`** -- `true` if the model is available for inference routing through Compute Finance; `false` if the model is in the CPI basket for pricing reference only. ### `GET https://api.compute.finance/v1/oracle/basket` Full basket composition: models array plus SCU breakdown, routing fee rate, revision version, and last-updated timestamp. ```json { "models": [ { "id": "gpt-4.1", "displayName": "GPT-4.1", "provider": { "key": "openai", "name": "OpenAI" }, "tier": "frontier", "integrated": true, "ctPricePerMillion": { "input": 133.3, "output": 533.3 }, "usdPricePerMillion": { "input": 2.0, "output": 8.0 }, "markedUpCtPricePerMillion": { "input": 139.97, "output": 559.97 }, "markedUpUsdPricePerMillion": { "input": 2.1, "output": 8.4 }, "oracleKeyPrefix": "gpt-4.1", "releasedAt": "2025-04-14T00:00:00Z" } ], "scu": { "frontier": 2.35, "standard": 1.12, "lightweight": 0.57, "total": 4.04 }, "scuUsd": 4.04, "routingFeeRate": 0.05, "revisionVersion": 42, "basketVersion": 42, "lastUpdated": "2026-05-07T10:15:30Z" } ``` ### `GET https://api.compute.finance/v1/oracle/tiers` Tier breakdown with weights and per-tier SCU contribution. ```json { "tiers": { "frontier": { "weight": 0.3, "models": 4, "avgCostUsd": 7.82, "contribution": 2.35 }, "standard": { "weight": 0.4, "models": 5, "avgCostUsd": 2.81, "contribution": 1.12 }, "lightweight": { "weight": 0.3, "models": 3, "avgCostUsd": 1.89, "contribution": 0.57 } }, "scuUsd": 4.04 } ``` ### `GET https://api.compute.finance/v1/oracle/history?range=30d` Daily SCU time series with per-tier breakdown. ```json { "range": "30d", "from": "2026-04-07", "to": "2026-05-07", "count": 31, "data": [ { "date": "2026-04-07", "scu": 3.89, "frontier": 2.15, "standard": 1.02, "lightweight": 0.72, "basketVersion": 40 }, { "date": "2026-05-07", "scu": 4.04, "frontier": 2.35, "standard": 1.12, "lightweight": 0.57, "basketVersion": 42 } ] } ``` ### `GET https://api.compute.finance/v1/oracle/reconstitutions` Reconstitution event log with per-event change details. ```json { "entries": [ { "id": "recon-1", "revisionVersion": 42, "previousVersion": 41, "publishedAt": "2026-04-16T14:30:00Z", "summary": "Quarterly reconstitution: replaced claude-opus-4.6 with claude-opus-4.7", "scuBefore": 3.89, "scuAfter": 4.04, "changes": [ { "type": "ModelRemoved", "modelKey": "claude-opus-4.6", "tier": "frontier", "description": "Removed claude-opus-4.6 from frontier tier" }, { "type": "ModelAdded", "modelKey": "claude-opus-4.7", "tier": "frontier", "description": "Added claude-opus-4.7 to frontier tier" } ], "txHash": "0xabc123..." } ] } ``` --- ## 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 | Field | Description | |---|---| | `cf_id` | Public identifier -- format: cf_usr_XXXXXXXXXXXX | | `email` | Used for notifications. Optional for wallet-only sign-in. | | `wallet_address` | On-chain address on Base. Created via account abstraction or connected externally. | | `display_name` | User-chosen name. Defaults to a truncated email or wallet address. | | `referral_code` | Permanent 8-character code -- format: cf_ref_XXXXXXXX | | `points_balance` | Current 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. --- ## Points Points track your engagement with Compute Finance -- signup, daily logins, oracle interactions, and referrals. As your balance grows, you unlock higher tiers. Points are append-only and recorded in a public ledger per CF ID. ### Tiers | Tier | Min Points | |---|---| | Explorer | 0 | | Starter | 500 | | Builder | 2,000 | | Architect | 5,000 | | Titan | 15,000 | ### How points are earned V1 supports six earning channels. New channels will be added in future versions and announced via the changelog. | Channel | Amount | Trigger | Frequency | |---|---|---|---| | Signup bonus | 100 pts | CF ID created | Once per account | | Referral (referrer) | 250 pts | Referred user completes signup | Per successful referral | | Referral (referred user) | 50 pts | User signs up via referral link | Once per account | | Daily login | 10 pts | User logs in on a new calendar day (UTC) | Once per day | | 7-day login streak bonus | 50 pts | User logs in 7 consecutive days | Once per streak completion | | Oracle interaction | 5 pts | User views a unique model's pricing on the oracle page | Up to 12 per day (one per model) | ### Ledger model The points ledger is an append-only log. No entries are ever updated or deleted. Your canonical points balance is the sum of all your ledger entries. The denormalized `points_balance` field on your CF ID record is a performance optimization that is reconciled periodically. | Field | Type | Description | |---|---|---| | `id` | UUID | Primary key | | `cf_id` | String (FK) | The user who earned the points | | `type` | Enum | One of: `signup`, `referral`, `referral_welcome`, `daily_login`, `streak_bonus`, `oracle_interaction` | | `amount` | Integer | Points earned (always positive -- append-only, no negative entries) | | `source` | String | Human-readable source descriptor (e.g. `referral:cf_usr_a3k9m2x7p1b4`, `oracle:gpt-5.4`) | | `created_at` | Timestamp | When the points were earned | The append-only design means: no points can be silently removed or altered, the complete earning history is preserved and queryable, and any future audit can reconstruct the exact points balance at any point in time. ### Streaks Use Compute Finance on consecutive calendar days to build a streak. Longer streaks earn bonus points. Your current streak and longest streak are shown in your profile. Streaks reset if you miss a calendar day (UTC). ### Leaderboard The top 50 users by total points are displayed on the public leaderboard, refreshed hourly. The leaderboard shows display name and points only -- no other profile data is exposed. ### Non-transferability Points are non-transferable in V1. They have no monetary value, are not convertible to any token or currency, and cannot be sold, traded, or assigned to another account. A points-to-credits conversion ratio for V2 will be announced before V2 ships, and the append-only ledger ensures all V1 earning history is preserved and can be converted accurately at that time. ### API endpoints Points data is queryable via the following endpoints. Authentication is required for endpoints that return personal data; the leaderboard is public. | Method | Path | Description | |---|---|---| | GET | `https://api.compute.finance/v1/points` | Your points summary (total, tier, current streak, longest streak) | | GET | `https://api.compute.finance/v1/points/history` | Paginated points ledger entries for your CF ID | | GET | `https://api.compute.finance/v1/points/leaderboard` | Top 50 users by total points (public, no auth) | --- ## 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 | Event | Points | Who Earns | |---|---|---| | New user signs up with your code | 50 pts | New user (welcome bonus) | | You referred a new user | 250 pts | Referrer | ### Sharing your referral link ``` // Referral URL format https://compute.finance/r/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: 1. A user visits `https://compute.finance/r/cf_ref_XXXXXXXX` 2. 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` 3. The click is recorded in the database with the referral code, timestamp, hashed IP address, and user agent 4. 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 5. 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. | Rule | Implementation | |---|---| | No self-referral | If the `cf_ref` cookie matches the signing-up user's own referral code, the referral is silently ignored | | Email deduplication | One CF ID per email -- a user cannot create multiple accounts with the same email to farm referral points | | IP rate limiting | Maximum 10 CF ID creations per IP address per 24 hours, preventing mass account creation from a single source | | Click rate limiting | Maximum 100 clicks per referral code per hour. Clicks beyond the limit are not recorded. | | Disposable email detection | Optional: 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. --- [Disclaimer](https://compute.finance/disclaimer) | [Terms](https://compute.finance/terms) | [Privacy](https://compute.finance/privacy) [X](https://x.com/computefin) | [LinkedIn](https://linkedin.com/company/compute-finance)