Using Kimi K3 and Claude Fable in OpenCode with Carpe Diem

Using Kimi K3 and Claude Fable in OpenCode with Carpe Diem
Beginner tutorial — from zero to your first AI-generated response right in your terminal.
What you'll get
By the end of this tutorial, you'll be able to write AI-assisted code directly in your terminal, using the Kimi K3 and Claude Fable models served by Carpe Diem (carpe-diem.xyz). No credit card, no email account: you pay per use in USDC straight from your own wallet.
In short, there are three main steps:
- 1. Install OpenCode (the AI coding assistant for your terminal).
- 2. Create a Carpe Diem API key (
cdm_…) from your wallet. - 3. Connect OpenCode to Carpe Diem and pick your model.
Expect about 15 minutes the first time.
Before you start (prerequisites)
You'll need:
- - A computer with Node.js installed (version 18 or newer). To check, open a terminal and type
node --version. - - An EVM wallet (MetaMask, Rabby, or WalletConnect) able to switch to the Base network.
- - A little USDC on Base to pay for requests (a few dollars is more than enough to get started).
What is a "terminal"? It's the black window where you type commands. On macOS it's the Terminal app, on Windows it's PowerShell or Windows Terminal, and on Linux it's your usual terminal emulator.
Step 1 — Install OpenCode
OpenCode is an open-source coding assistant that lives in your terminal. It can talk to any OpenAI-compatible API — and Carpe Diem is one of them.
Open your terminal and install it:
npm install -g opencode-ai
Check that the installation worked:
opencode --version
If a version number shows up, you're ready. 🎉
Step 2 — Create your Carpe Diem API key
Everything happens in the Carpe Diem dashboard. Head over to carpe-diem.xyz/dashboard.
2.1 Connect your wallet
Click Connect Wallet and choose your wallet (MetaMask, Rabby…). Carpe Diem runs on the Base network: if your wallet isn't already on it, the dashboard will offer to switch automatically.
No email, no password: your wallet is your account.
2.2 Add funds
Deposit USDC so you can pay for your requests. You have two options (both cost exactly the same per request):
- - Prepaid (recommended) — your USDC is deposited into a dedicated account that you own: you can withdraw the balance anytime.
- - Credits — a non-refundable balance you top up and burn down (1 credit = $0.01, so $10 = 1,000 credits).
To get started, pick Prepaid: it's just as simple, but your funds stay yours.
2.3 Generate the API key
Sign once with your wallet (free, no gas fees) to open your account area, then click Create an API Key.
⚠️ Important: the key looks like cdm_xxxxxxxxxxxxxxxx and is shown only once. Copy it right away and keep it somewhere safe. If you lose it, you'll have to create a new one.
Step 3 — Connect OpenCode to Carpe Diem
There are two small settings to configure: telling OpenCode where Carpe Diem lives (the URL), and giving it your key (the password).
3.1 Create the configuration file
OpenCode is configured with an opencode.json file. You can place it:
- - in your project folder (settings specific to that project), or
- - in
~/.config/opencode/opencode.json(settings that apply everywhere).
For a beginner, the easiest is the global file. Create it with this content:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"carpe-diem": {
"npm": "@ai-sdk/openai-compatible",
"name": "Carpe Diem",
"options": {
"baseURL": "https://carpe-diem.xyz/api/operator/v1"
},
"models": {
"kimi-k3": { "name": "Kimi K3" },
"claude-fable": { "name": "Claude Fable" }
}
}
}
}
Line-by-line breakdown:
- "carpe-diem"→ this is the identifier for your provider. Remember it: you'll use it again in a moment.- "npm": "@ai-sdk/openai-compatible"→ tells OpenCode that Carpe Diem speaks the standard "OpenAI-compatible" language. You don't need to install anything, OpenCode handles it.- "baseURL"→ the Carpe Diem API address. This is the only "magic" line you need to copy exactly.- "models"→ the list of models you want to see, each with a readable display name.
How do you find a model's real identifier? The names
kimi-k3andclaude-fableare examples. The exact technical identifier may differ slightly from the display name. To get the official list, call the models endpoint with your key:curl https://carpe-diem.xyz/api/operator/v1/models \ -H "Authorization: Bearer cdm_your_key_here"Use the
idreturned by this list in the"models"section of your config.
3.2 Register your API key
Your key does not go into opencode.json (so you don't share it by accident). OpenCode stores it separately. The easiest way is the interactive command:
opencode auth login
Then:
- 1. Scroll down and choose "Other".
- 2. When asked for the provider identifier, type exactly
carpe-diem(the same one as in your config). - 3. Paste your
cdm_…key when asked for the API key.
Done: the key is stored securely, kept separate from your configuration.
Step 4 — Use Kimi K3 or Claude Fable
Launch OpenCode from your project folder:
opencode
Once the interface opens, type the command:
/models
You should see your Carpe Diem models appear, for example:
- carpe-diem/kimi-k3— shown as Kimi K3- carpe-diem/claude-fable— shown as Claude Fable
Select the one you want, then ask your question or request a coding task. For example:
"Create a Python script that reads a CSV file and prints the sum of a column."
And there you go: your request travels to Carpe Diem, which privately routes it to the chosen model, and the response appears in your terminal. Each response is billed per use, deducted from your USDC balance.
Tip: you can switch between models anytime with
/models. Try Kimi K3 for code, Claude Fable for reasoning or writing, and compare.
Troubleshooting
The model doesn't show up in /models?
Restart OpenCode. Changes to opencode.json are only picked up on (re)start.
Authentication error (401 / 403)? Check that:
- - the provider identifier in
opencode auth login(carpe-diem) is identical to the one in your config; - - your key starts with
cdm_and was copied in full; - - your USDC balance isn't at zero (Carpe Diem dashboard).
"model not found" error?
The model identifier doesn't match the catalog. Get the correct id via the curl …/v1/models command from Step 3.1, and fix the "models" section.
OpenCode seems to ignore the Carpe Diem URL?
Make sure the "baseURL" key points exactly to https://carpe-diem.xyz/api/operator/v1 (with /v1 at the end for OpenAI-compatible mode), then restart.
Going further
- - Try it without installing OpenCode: the Playground in the dashboard (carpe-diem.xyz/dashboard/playground) lets you try the models directly in your browser, with just your wallet signature.
- - Track your usage: your balance and usage history are visible in the dashboard.
- - Full documentation: carpe-diem.xyz/docs and the API reference.
- - Community & support: the Carpe Diem Telegram.
Happy coding! With Carpe Diem, you get access to state-of-the-art models, paying only for what you use — and without ever surrendering your identity.