clawdie-iso/doc/DEEPSEEK-V4-SMOKE.md

4.9 KiB

Pi + DeepSeek v4 Smoke Lane

Status: PASS — lane confirmed working Owner: Opencode / Z.ai Integrator Date: 2026-05-24

Official API Reference

Available Models (from pi --provider deepseek --list-models)

pi model ID API model ID Context Max output Thinking Images
deepseek-v4-flash deepseek-v4-flash 1M 384K yes no
deepseek-v4-pro deepseek-v4-pro 1M 384K yes no

Deprecated names (retired 2026-07-24): deepseek-chat → v4-flash non-thinking, deepseek-reasoner → v4-flash thinking.

Pricing (per 1M tokens)

Model Input (cache hit) Input (cache miss) Output
deepseek-v4-flash $0.0028 $0.14 $0.28
deepseek-v4-pro $0.003625* $0.435* $0.87*

* 75% promotional discount ends 2026-05-31, then 1/4 of original.

Key Management

export DEEPSEEK_API_KEY="<your-key>"
pi --provider deepseek ...
unset DEEPSEEK_API_KEY

pi auth.json (persistent)

pi --provider deepseek --api-key "<your-key>"

This writes to ~/.pi/agent/auth.json. Pi prefers auth.json over env vars when both exist.

Per-command (no env, no file)

pi --provider deepseek --api-key "<your-key>" -p "hello"

pi provider prefix shorthand

pi --model deepseek/deepseek-v4-flash -p "hello"

The provider/model prefix selects the provider automatically — no --provider flag needed.

Smoke Result

  • Provider: deepseek
  • Model: deepseek-v4-flash
  • API: openai-completions
  • Content: COLIBRI_SMOKE_OK confirmed
  • Thinking: enabled (v4-flash defaults to thinking mode)
  • Usage: 3688 input tokens, 32 output tokens
  • Cost: $0.00052528
  • Event types: session, agent_start, turn_start, message_start, message_end, message_update, message_update (many), turn_end, agent_end
  • Capture: tmp/deepseek-v4-smoke.jsonl
  • Verdict: PASS

Confirmed Working Commands

# List models
DEEPSEEK_API_KEY="<your-key>" pi --provider deepseek --list-models

# One-shot JSONL smoke
DEEPSEEK_API_KEY="<your-key>" pi --provider deepseek --model deepseek-v4-flash -p --mode json "hello"

# Shorthand (no --provider needed)
DEEPSEEK_API_KEY="<your-key>" pi --model deepseek/deepseek-v4-flash -p --mode json "hello"

Where to Replace the Test Key

The test key used for the initial smoke has been rotated. To set up a permanent key, edit:

~/.pi/agent/auth.json

Or export in your shell profile:

export DEEPSEEK_API_KEY="<production-key>"

Verifying Key Deletion / Revocation

1. Confirm the key is gone from pi

cat ~/.pi/agent/auth.json

If empty {}, no stored key. If it contains a deepseek entry, remove it:

# Back up first
cp ~/.pi/agent/auth.json ~/.pi/agent/auth.json.bak
# Edit to remove the deepseek entry, or wipe entirely:
echo '{}' > ~/.pi/agent/auth.json

2. Confirm the env var is unset

echo "DEEPSEEK_API_KEY is set: ${DEEPSEEK_API_KEY:+yes}"

If blank, no env key. If still set:

unset DEEPSEEK_API_KEY

3. Confirm the revoked key is rejected by the API

DEEPSEEK_API_KEY="<revoked-key>" pi --provider deepseek --model deepseek-v4-flash -p "test" 2>&1

Expected error:

401 Authentication Fails, Your api key: ****XXXX is invalid

If you see 401, the key is properly revoked at DeepSeek's side.

4. Confirm clean "no key" state

pi --provider deepseek --model deepseek-v4-flash -p "test" 2>&1

Expected error:

No API key found for deepseek.

If you see this, pi has no stored or env key for DeepSeek — fully clean.

Error Reference

Scenario Error message
No key at all No API key found for deepseek.
Revoked / invalid key 401 Authentication Fails, Your api key: ****XXXX is invalid
Rate limited (too many reqs) 429 Rate limit reached...
Quota exhausted 402 Insufficient balance

Deletion Criteria

  • Lane confirmed in agent capability table
  • Colibri can consume pi JSONL events from this provider