● Documentation

Carpe Diem — Documentation

One OpenAI- and Anthropic-compatible API for Venice's models and more — inside a TEE or at the best price across markets, pay-as-you-go, from your code, your coding agent or your AI assistant.

What Carpe Diem is

Carpe Diem is a marketplace for AI inference on Base. You call language, image, audio, video and embedding models — Venice's catalogue, including Claude, GPT, DeepSeek, Kimi, Qwen and GLM models — through one OpenAI- and Anthropic-compatible API, and you pay only for what you use, usually below Venice's own list price.

Requests are served two ways:

  • Inside Carpe's TEE (/v1): sealed hardware that neither the host nor the Carpe Diem team can read, in front of Venice.ai, the privacy-first AI provider.
  • At the best price (/router): each request is priced across Carpe and several other markets, and the cheapest serves it — with a switch to stay on TEE markets or on markets that keep nothing.

There are three ways in:

ForStart here
The APIYour code, your coding agent (Claude Code, OpenCode, Aider…), your chat appQuick start, then Integrations
The MCP serverYour AI assistant (Claude Desktop, Claude Code, Cursor, Codex, VS Code… locally; claude.ai and ChatGPT through the hosted connector), which gets image, video, voice, music, web search and every model as toolsIntegrations → MCP server
The web appTrying models, generating images and video, without codeCreate

And DIEM holders can earn by selling the Venice inference allowance they do not use: see Becoming a provider.

Our place in the Venice ecosystem

Carpe Diem is not a competitor to Venice — it extends it. Staking DIEM on Venice grants a daily inference allowance of roughly $1 per DIEM; most holders never use all of it, and whatever is unspent at the daily reset is lost. Carpe Diem turns that idle allowance into a marketplace: a DIEM holder provisions a key and earns on demand they would otherwise have wasted, a developer gets Venice models at a lower, market-driven price, and more of the network's capacity is actually used.

Quick start

From zero to a first answer in a few minutes. Everything happens in the API space of the site.

1. Sign in

Open API → Start and sign in with an EVM wallet (MetaMask, Rabby, WalletConnect…) — a free signature, no gas — or with your email address. No KYC either way.

2. Add funds

In API → Balance, with a wallet on Base:

  • Credits — deposit USDC (or another token, swapped to USDC in the same transaction) for a balance you burn down per request. 1 credit = $0.01.
  • Prepaid account — deposit USDC onto an account created for you and that you own; Carpe pulls only the exact cost of each request, and you can withdraw the rest anytime.

Card payment, for accounts without a wallet, is being opened. The differences between the rails are in Ways to pay.

3. Create an API key

In API → Keys, create a key. It looks like cdm_… and is shown only once: copy it somewhere safe. Create one key per app or agent, so each one's spending is visible on its own, and revoke any of them at any time.

4. Your first call

curl https://carpe-diem.xyz/api/operator/v1/chat/completions \
  -H "Authorization: Bearer $CARPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-v4-flash", "messages": [{"role": "user", "content": "Hello in one sentence."}]}'

Any model id from /v1/models works in model; the Pricing page shows them with live prices — click one for what it does, the parameters it accepts, a request that works and its variants, or link straight to it with /pricing?model=<id>.

5. Next

  • Plug Carpe into your tools — Claude Code, OpenCode, Cursor, the OpenAI or Anthropic SDK, LangChain, Open WebUI…: Integrations.
  • Give your AI assistant image, video, voice and web tools: MCP server.
  • Complete recipes with code and costs — images, video, voice, RAG, web research, extraction: Use cases.
  • Every endpoint: API reference.

How it works

The big picture

A request makes a round trip through the operator, a private proxy running in a TEE in front of the model providers:

1YouAPI key — OpenAI / Anthropic-compatible request
2Carpe Diem Operator/v1: picks a provider key · /router: picks the cheapest marketTEE · sealed
3Venice.ai — or the winning marketgenerates the response
4Carpe Diem Operatordebits your balance, relays the responseTEE · sealed
5Youreceive the response

On /v1, the operator forwards your request to Venice with a provider's key, relays the answer and debits your balance. On /router, it first prices the request on every market — Carpe itself, and external ones — and sends it to the cheapest that can serve it (see Two surfaces). Either way you only ever hold your cdm_ key.

The building blocks

The escrow — payments and balances, on-chain. The escrow is a single smart contract on Base. When you buy credits, your USDC is paid into it and an on-chain entry records your credit balance — the amount of inference you're entitled to spend. Credits are a usage entitlement, not a deposit: there is no withdrawal, and the incoming USDC becomes protocol funds that pay providers and run the network. (The other rails — the prepaid account and wallet payments (x402), see Ways to pay — work differently: there the funds stay in an account you own and can withdraw from; the escrow only pulls the exact cost per request.) Because the contract is public, anyone can verify total balances and on-chain settlement at any time.

The operator — the private brain. The operator authenticates your API key, picks an available provider, forwards your request to Venice, and relays the response back. It runs inside a TEE (Trusted Execution Environment) — sealed hardware where even the host machine and the Carpe Diem team cannot read what's inside. This is what keeps your prompts and the providers' Venice keys confidential.

Venice — the inference. Venice.ai performs the actual model execution. The operator holds providers' Venice keys and uses them to serve your request; you never see or handle a Venice key yourself.

On-chain balance vs. live credit balance

Your credit balance is tracked in two places, and it's worth knowing why:

On-chain (escrow ledger)Operator (live ledger)
Answers"what's recorded on the blockchain""what I can spend right now"
Updateson purchase + at periodic settlementon every request
Liveson Base (public, verifiable)inside the TEE

When you make a request, your live balance is debited instantly inside the operator. The on-chain entry only changes when you buy more credits, or when the operator periodically settles a batch of usage on-chain. Between settlements the two can differ: the on-chain figure reflects purchases, while the live figure reflects purchases minus everything you've already spent.

Think of it like a prepaid card: buying credits loads the card (recorded on-chain); each request is a tap that draws down the live balance instantly. The operator reconciles its books with the chain periodically — that's settlement.

The life of a request

From the moment you call the API to the moment providers get paid:

  1. You send a request with your API key (cdm_…) to a standard endpoint like /v1/chat/completions (or /router/chat/completions, which first compares markets — see Two surfaces).
  2. The operator authenticates the key and resolves it to your wallet.
  3. It runs a pre-flight check — do you have enough live credits, and does a provider have enough Venice capacity to serve this? Without the credits, the request is refused cleanly, before any inference happens; without the capacity, it gets a 503 with Retry-After — from November 19, 2026, Venice will serve it at its list price + 5% instead (see Pricing).
  4. It picks a provider based on real-time health and available capacity.
  5. It forwards the request to Venice, which runs the model and returns the response to the operator.
  6. It prices and debits — the operator computes the cost (Venice's list cost × 55%), debits your live credit balance instantly, and records the usage.
  7. It relays the response back to you, including headers that report your remaining credits.

Up to here nothing has touched the blockchain — it's all instant, inside the TEE. Paying providers happens separately:

  1. Settlement. As usage accumulates, the operator periodically settles a batch on-chain in a single transaction: it converts the owed USDC into DIEM, distributes it to the providers who served the requests, and takes the protocol fee. This is the only on-chain write in the normal flow — batching it keeps the gas cost per request negligible.

Two surfaces: /v1 and /router

Same key, same request bodies, two base URLs:

https://carpe-diem.xyz/api/operator/v1https://carpe-diem.xyz/api/operator/router
Served byCarpe alone, through its TEE, with VeniceThe cheapest market for each request: Carpe, Surplus, AntSeed, OpenRouter, Chutes, Venice or Engy
ConfidentialityAlways through the TEEMay leave it — send "privacy": true to stay on TEE markets, "privacy": "private" to stay on markets that keep nothing
PriceCarpe's fixed price: 55% of Venice's list priceThe winning market's price, plus a routing fee on external markets
Tells youX-Carpe-Cost-Usdc-MicroX-Carpe-Route-Market, X-Carpe-Route-Cost-Usdc, X-Carpe-Route-Saved-Usdc

Quote a request on every market before sending it, for free: POST /router/quote. The router section of the API reference has the path mapping, the market list and how to pin one.

Ways to pay

Pay-as-you-go: no subscription, no minimum. All rails pay the same price per request; they differ in how the money is held.

CustodyWithdrawableNeeds a cdm_ keyBest for
Prepaid accountAn account you own (ERC-4337, controlled by your wallet)YesYesWallet users who want their funds to stay theirs
CreditsA usage balance held by the protocolNoYesTopping up and burning down; the only rail for email accounts
Wallet (x402)Your wallet, nothing pre-funded—NoAutonomous agents without an account

Prepaid account. Deposit USDC from API → Balance: the account is created and authorised in the same gas-free step. Carpe only pulls the exact cost of each request, and you can withdraw the rest to your wallet, or revoke, at any time.

Credits. Deposit USDC (or swap another token in the same transaction) for a non-refundable usage balance: the USDC becomes protocol funds that pay providers. 1 credit = $0.01. Credits are never converted or withdrawn.

Wallet (x402). An agent with a private key and USDC on Base pays each request from its wallet, with no signup and no key: it receives a 402 challenge, signs once (a permit capped at its budget) and resends. See Pay per request.

Which rail pays. Your account has a payment mode — credits, prepaid, or auto (credits first, then the prepaid account) — set in API → Balance; a key can be given a mode of its own when you create it. If the rail cannot cover a request, the answer is 402 PAYMENT_REQUIRED, before anything is run. Email accounts pay with credits.

Every response reports what it cost and what is left (X-Carpe-Available-Credits), so an app or an agent can budget itself; GET /v1/credits returns the balance on demand.

Pricing

Carpe Diem sells every model at 55% of Venice's list price — the same on every model, at any hour, whatever the size of the request. The 5% protocol fee is inside that price, not added to it.

  • One price. No floor, no ceiling, no time of day, no premium for a large request: what costs $0.10 at Venice's list price costs $0.055 here.
  • The fee is inside it. Of the 55%, the protocol takes 5 points first; the provider whose key served the request earns 80% of the rest — 40% of Venice's list price — and the protocol keeps 20%.
  • When Carpe is full. Providers' staked DIEM gives the marketplace a daily allowance, renewed at 00:00 UTC. Once it is used up, /v1 answers 503 with Retry-After until it is renewed. From November 19, 2026, it will not refuse your request any more: Venice will serve it at Venice's list price + 5%, and the response will say so (X-Carpe-Served-By: venice-reserve). Video is the exception since December 1, 2026: it keeps the 503. See When Carpe is full.
  • It follows Venice's list price. When Venice changes a model's price, Carpe's is 55% of the new one.

Example. A request costs $0.10 at Venice's list price.

  • On /v1: $0.055, morning or evening, short or long.
  • Once Carpe's daily allowance is used up, from November 19, 2026: $0.105, served by Venice.

Video is priced per clip — its length, resolution and audio. The Pricing page shows each video model's from-price (its cheapest clip), and POST /v1/video/quote gives the exact price of yours, free.

Every model's price is on the Pricing page and in /pricing; GET /v1/capacity says how much of today's allowance is left. The best-price router may find an even lower price on another market — see Two surfaces.

Authentication

API keys (cdm_…) — for calling the API. Send Authorization: Bearer cdm_… on every request. Keys do not expire; you can hold several and revoke any of them instantly from API → Keys — or let a leaked key revoke itself with POST /v1/keys/self/revoke. The Anthropic endpoints (/v1/messages) also accept the key as x-api-key.

Sessions — for managing your account. Signing in on the site, with a wallet signature or an email code, opens a session (a token valid 30 minutes, renewed while you are active, for at most 8 hours). Creating or revoking keys and changing payment settings need a session: an API key cannot manage keys, so a leaked key cannot mint more.

x402 — no account at all. An agent's signed USDC permit is both its payment and its identity. See Ways to pay.

Models

Carpe serves Venice's whole catalogue, synced automatically — about 400 models today:

Type (carpe_diem_type)What it doesEndpoint
textChat, reasoning, code, vision/v1/chat/completions, /v1/messages
embeddingVector embeddings/v1/embeddings
image, imageEdit, upscaleGenerate, edit, upscale/v1/image/generate, /v1/image/edit, /v1/image/upscale
video, imageToVideo, referenceToVideoText-, image- or reference-to-video (async)/v1/video/queue
tts, asr, musicSpeech, transcription, music and sound (async)/v1/audio/speech, /v1/audio/transcriptions, /v1/audio/music/queue

GET /v1/models is the OpenAI-compatible list (it works with client.models.list()); each entry also carries:

  • privacy — private (Venice runs the model without keeping prompts or answers) or anonymized (served through a third party, such as Claude and GPT models, without your identity).
  • capabilities — vision, tool calling, reasoning, JSON schema, web search, TEE attestation…
  • constraints — the parameters the model accepts: durations and sizes for video, voices for speech, lengths for music. Read them before building a form.
  • tier — standard, premium or frontier: Venice's price class for the model; Carpe charges 55% of it.

GET /models returns the same catalogue grouped by type; GET /models/:id returns one model in full, with its maker's description; and GET /router/models adds, for each text model, the markets that can serve it.

Privacy & security

No KYC. A wallet or an email address is all an account is. With x402, not even that: the wallet is the identity.

Sealed execution. The operator runs in a Trusted Execution Environment (Intel TDX on Phala Cloud): the host and the Carpe Diem team cannot read into it. Your prompts and answers, the providers' Venice keys and the live ledger stay inside. On /v1 every request goes through it; on /router, a request may be served by an external market, unless you send "privacy": true (TEE markets only) or "privacy": "private" (markets that keep nothing).

Private models. Beyond the TEE, pick a model listed privacy: "private": Venice serves it without retaining anything.

Verifiable, not "trust us". The TEE produces a hardware attestation of the exact code it runs: GET /attestation, or the Privacy page.

Transparent money. Deposits, settlements, fees and total balances are on Base, public and auditable.

Private (inside the TEE)Public (on Base)
Your prompts & responsesDeposits & settlements
Providers' Venice keysTotal balances & fees
Live credit ledgerContract code & roles

Limits & errors

  • Rate limits. Per account: 600 requests a minute today, growing with your parallel lanes (one per $10 of credit), plus a separate budget for free reads such as your balance. Read yours with GET /v1/rate_limits. Each model also has Venice's own limits: GET /v1/limits/:model and GET /v1/capacity.
  • Errors are JSON with a stable code; the chat endpoints use OpenAI's error shape, /v1/messages Anthropic's. The ones to handle: 402 PAYMENT_REQUIRED (top up), 429 (wait Retry-After), 503 (no capacity at a price your balance covers, or the model is saturated — retry later), 400 INVALID_TOOLS (a tool definition is malformed). The full table, with what to retry: Errors & retries.
  • Regions. Sanctioned countries are refused (451). Buying inference from the United States is allowed; providing and staking are not.
  • What is not there. Carpe serves Chat Completions, not OpenAI's Responses API (/v1/responses), and has no /v1/messages/count_tokens. Tools that need either are listed in Integrations.

Becoming a provider

The idea

There are two ways to become a provider, and they differ only in where the Venice key comes from.

Bring your own key. If you stake DIEM on Venice, you have a daily inference allowance you probably don't fully use. You lend that allowance to the marketplace: Carpe Diem routes paid requests to your Venice key, and you earn DIEM on every request you serve — turning idle capacity into revenue. See Provisioning your Venice key.

Or stake DIEM here and let us mint one. If you hold DIEM but have no Venice account, the operator can mint a key for you inside its enclave, where it stays sealed — you never see it, and neither do we. See Staking DIEM instead.

Either way the money works the same:

You earn 80% of the value of every request your key serves, after a protocol surcharge (5% of the Venice base cost, skimmed first; the protocol keeps the surcharge plus 20% of the rest). With the fixed price that is 40% of Venice's list price on every request — about 73% of what the buyer paid — the Revenue tab's Where every dollar goes panel shows your window's real figures. Earnings accrue in DIEM, yours to withdraw on-chain anytime.

Provisioning your Venice key

  1. Create a Venice inference-only API key in your Venice account, ideally with a consumption limit and an expiry. An inference key is all Carpe Diem needs — there's no reason to provision an admin key.
  2. Open the Earn page and connect the wallet that stakes your DIEM.
  3. Sign a message (free, no gas) to prove you own the wallet, and submit your Venice key.
  4. Choose persistence: persisted (encrypted at rest, survives reboots) or RAM-only (re-provision after each restart — maximum secrecy).

Your Venice key is encrypted inside the TEE the moment it arrives — never visible to the host or the Carpe Diem team in operation. A persisted key is also part of an encrypted disaster-recovery copy, which only an offline recovery key held by Lumen Labs can open, and which serves only to restore the service if the operator's storage is lost; a RAM-only key never leaves the TEE. You can register up to 5 keys per wallet to multiply your capacity.

Key hygiene. The TEE protects your key in use — it's never written to disk in clear, logged, or exposed, and an admin session cannot read it out of the enclave: the only copy that leaves it is the encrypted disaster-recovery copy above. Scoping the key to inference-only, with a limit and expiry is simply defense-in-depth that stays entirely under your control, and you can revoke it anytime — from Venice, or from the provider page, which removes it from the TEE immediately.

Staking DIEM instead, and letting us mint the key

If you have no Venice account, the stake door of the Earn page does the whole setup from DIEM alone. You sign every transaction yourself; no key of yours is ever shared, because there is no key of yours — the operator mints one inside its enclave and seals it there.

  1. Credential. Venice will only mint a key for a wallet holding some staked VVV. If you have none, the page prices a swap of a few cents' worth from your ETH, shows you the figures, and sends nothing until you confirm.
  2. Stake DIEM. This is the fuel: staked DIEM is the inference capacity your key serves with. It stays staked in your own name and you can unstake it yourself, subject to Venice's cooldown of about a day.
  3. Mint. You sign a challenge from Venice; the operator relays it and seals the resulting key in its TEE.
  4. Choose your markets. Carpe's own buy-side is always on. Carpe Reach is opt-in — your key also serves more buyers, through our partner Surplus Intelligence, which holds a dedicated Venice key while you sell: tick it when you mint and accept its terms, shown right under the box, and selling starts as soon as your key is ready — one more free signature. Your reward splitter is created at mint either way, so you can also turn selling on later from the Markets tab.

How you get paid differs by market, and this is the part worth reading twice. Carpe's own traffic pays in DIEM directly to your wallet's escrow balance, with no fee — the protocol already takes its margin on the request itself, so taking another cut here would be charging you twice. Carpe Reach pays USDC through a RewardSplitter deployed in your name: 90% you, 10% the treasury, immutable. That splitter is the only rail that carries a fee. It is deployed when your first key is minted, whether you tick Carpe Reach or not — it has to be recorded on the key then, and a key minted without one could never join Carpe Reach later. Topping up an existing key never deploys one.

Everything is pull. Both balances accrue on-chain until you claim them; nothing is ever pushed into your wallet unasked.

A key minted this way is owned by the operator on your behalf, so it does not appear in the Keys table of the provider dashboard — that table lists keys you provisioned yourself (the tab counts your staked keys on one line). Your capacity lives on the Stake tab, its markets on the Markets tab, and both claims — the escrow's DIEM and the splitter's USDC and DIEM — on the Revenue tab.

Earning & withdrawing

As your key serves requests, your DIEM earnings accrue on-chain, credited at each settlement. Withdraw them anytime with the escrow's withdrawDiem — they go straight to your wallet. Track pending and lifetime earnings via GET /provider/stats and the Earn console, where the claim is.

Monitoring & control

  • Per-request log — GET /provider/usage returns every request your key served, newest first, each with a timestamp, model, and cost. It's the definitive record of exactly what Carpe Diem routed through your key and when — including very recent requests not yet settled on-chain.
  • Stats & yield — GET /provider/stats for request counts and earnings; GET /providers/:wallet/yield for your APR on DIEM sold (aprOnSold7d): every revenue — Carpe sales, Carpe Reach sales and the router's idle-capacity rebate — divided by the DIEM you sold on Carpe and on Carpe Reach over the last 7 days, annualised. sold7d says how many DIEM that was; Carpe Reach is measured through Carpe Diem's seller account with the partner. In the API, Carpe Reach is the surplus market and its fields.
  • Revoke anytime — remove one key or your whole provider registration with DELETE /tee/providers/:address (or per key with …/keys/:keyId). The key stops receiving traffic immediately.

FAQ

Do I need an account? To use an API key, yes — a wallet or an email address, no KYC. An agent paying with x402 needs no account at all.

How do I pay? In USDC on Base: credits, or a prepaid account you own; agents can pay per request from a wallet. Card payment is being opened. See Ways to pay.

Is it cheaper than going direct? On /v1, every model costs 55% of Venice's list price, fee included — from November 19, 2026, Venice's list price + 5% only once Carpe's daily capacity is used up. On /router, you get the cheapest market for each request.

Which models? Venice's whole catalogue — text (including Claude and GPT models), code, image, video, speech, music, embeddings. GET /v1/models or the Pricing page.

Can I use it with Claude Code, Cursor, ChatGPT…? Claude Code, OpenCode, Aider, Cline, Continue, Zed and VS Code can run on Carpe models; Claude Desktop, Claude Code, Cursor, Codex, VS Code and others can use the MCP server. claude.ai (web, desktop, mobile) and ChatGPT use the hosted connector, https://mcp.carpe-diem.xyz/mcp, signed in with your Carpe Diem account; Claude Code, Cursor, VS Code, Codex, Gemini CLI and Sub Rosa can use it too, without a key. Details: Integrations.

Can anyone see my prompts? On /v1, no: requests are processed inside the TEE, and with a private model the provider keeps nothing. On /router, an external market may serve the request unless you ask for privacy.

What if there is not enough capacity? On /v1, a pre-flight check refuses cleanly (503 with Retry-After) before anything runs or is charged; the router can also fall back to another market. From November 19, 2026, Venice will serve such a /v1 request at its list price + 5% instead, and the response will say so — unless your balance cannot cover that price.

Which network? Base (Ethereum L2): escrow, settlement and USDC.

Support

Updated 2026-11-19