Get started
DeepSeek setup
Connect your DeepSeek API key, choose between V4 Pro and V4.1 Flash, and set thinking effort.
RaptorCode runs on the official DeepSeek API with your own key. It calls nothing else: no RaptorCode server sits between you and DeepSeek, and usage is billed by DeepSeek to your account.
#Add your API key
Create a key at platform.deepseek.com/api_keys. RaptorCode finds it in this order, the same way for every command:
- The
DEEPSEEK_API_KEYenvironment variable. - The key saved by
raptorin~/.raptor/.credentials.
If neither exists, raptor asks for a key on first run. It checks the key with DeepSeek’s free balance endpoint, so no tokens are spent, and saves it owner-only. A valid key on an account without balance is still saved, with a top-up hint.
export DEEPSEEK_API_KEY=sk-...
raptor$ raptor
DeepSeek API selected.
Get your API key at: https://platform.deepseek.com/api_keys
Paste your DeepSeek API key: sk-...
✓ Connection established. API key saved to ~/.raptor/.credentialsThe key is never printed, logged, put in a prompt or written to your repository. A key from the environment is never written to disk. Inside the REPL, /api replaces the saved key without echoing it.
#Models
| Model id | Model | Notes |
|---|---|---|
deepseek-v4-pro | DeepSeek V4 Pro | The default. Text only. |
deepseek-flash | DeepSeek V4.1 Flash | Faster and cheaper; DeepSeek publishes higher agentic benchmark scores for it than for V4 Pro. |
Both have a 1,048,576-token context window, up to 384K output tokens, tool calls, JSON output and thinking mode. Retired names such as deepseek-v4-flash, deepseek-chat and deepseek-reasoner are mapped to deepseek-flash; any other id is sent unchanged, so a model DeepSeek adds later works without a new RaptorCode release.
#Choose a model
The model is chosen in this order:
raptor run --model <id>for that run.- The
RAPTOR_MODELenvironment variable. - The last choice made with
/modelin the REPL, saved in~/.raptor/model. deepseek-v4-pro.
The REPL, raptor chat, raptor run, raptor swarm run and the planning commands all follow the same order, and a live swarm runs on the session’s model.
RAPTOR_MODEL=deepseek-flash raptor swarm run "Add pagination to the API"#Thinking mode and effort
Thinking mode is on by default. /thinking in the REPL turns it off and back on.
| Where | Default effort |
|---|---|
| The interactive REPL and the live swarm | max |
raptor run | max, or --effort low|high|max |
raptor chat and the planning commands | high |
/effort cycles low → high → max without resetting the conversation. Every generation allows up to 128K output tokens, so large file writes are not cut off; output is billed as generated, so the larger budget costs nothing by itself.
#Balance and cost
/balancein the REPL shows your DeepSeek account balance.- When usage is returned, the REPL shows the context size and the share of the prompt served from DeepSeek’s cache.
raptor runprints input, cached and output token totals at the end. - A swarm runs four agents at once, so it uses about four times the tokens of a single agent.
- DeepSeek caches prompt prefixes automatically. RaptorCode only ever appends to a conversation, so later requests reuse the cached prefix and cost less.
Use deepseek-flash for routine work and quick iterations, and V4 Pro when you want the most depth on a hard problem.
#When something goes wrong
| What you see | What it means |
|---|---|
| HTTP 401 or 403 | The key was rejected. The REPL offers to enter a new one without losing the conversation. |
| HTTP 402 | The account has no balance. Top up at platform.deepseek.com/top_up. |
| HTTP 429 or 503 | Rate limited or overloaded. RaptorCode retries with backoff and honours Retry-After. |
The full request behaviour, including retries, finish reasons and the context budget, is in the models reference.