RAPTORCODE Docs

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:

  1. The DEEPSEEK_API_KEY environment variable.
  2. The key saved by raptor in ~/.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.

Environment
export DEEPSEEK_API_KEY=sk-...
raptor
Saved by the REPL
$ 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/.credentials

The 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 idModelNotes
deepseek-v4-proDeepSeek V4 ProThe default. Text only.
deepseek-flashDeepSeek V4.1 FlashFaster 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:

  1. raptor run --model <id> for that run.
  2. The RAPTOR_MODEL environment variable.
  3. The last choice made with /model in the REPL, saved in ~/.raptor/model.
  4. 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.

WhereDefault effort
The interactive REPL and the live swarmmax
raptor runmax, or --effort low|high|max
raptor chat and the planning commandshigh

/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

  • /balance in 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 run prints 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 seeWhat it means
HTTP 401 or 403The key was rejected. The REPL offers to enter a new one without losing the conversation.
HTTP 402The account has no balance. Top up at platform.deepseek.com/top_up.
HTTP 429 or 503Rate 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.