Home/Config/API Key
API Key Setup

API key setup is where many CodeWhale sessions succeed or fail before any mode or tool detail even matters

Once the binary works, the next hard boundary is provider authentication. API key mistakes often look like install or runtime issues, but they belong to a narrower layer: whether the right credential is present in the right place for the provider you actually chose.

Site detail pageSet Up the CodeWhale API Key (DeepSeek TUI Guide)Config

Questions this page should answer fast

  • Where should the API key live: file, environment variable, or provider block?
  • How do you tell a missing key apart from a wrong provider selection?
  • Which checks prove auth is the real failure layer?

What to verify next

  • Confirm the key belongs to the provider configured in CodeWhale.
  • Check for typos, empty values, and shell profile drift.
  • If auth works but behavior is odd, move into provider setup or config file checks next.

Common mistakes

  • Setting a key for one provider while the config points at another.
  • Leaving multiple shells with different exported credentials.
  • Assuming an auth error means the binary install is broken.

Recommended reading order

Move through the page by workflow need first, then branch into adjacent detail pages or hubs.

Step 1

Confirm the provider first

Before touching a key, verify which provider path your current config actually expects.

Step 2

Place one source of truth

Use one clear credential source first so you can test without wondering whether file and environment values disagree.

Step 3

Run a minimal live request

Validate with the simplest request path you can, before layering modes, MCP, or other advanced behavior on top.

Use-it-now examples

Start from working examples first, then adjust the details.

Environment-first auth check

Keep the first pass simple: one credential source, one shell, one live request path.

export DEEPSEEK_API_KEY="your-key-here"
deepseek

Before you blame the key

Confirm the shell really sees the value you think it sees before editing more config.

echo "$DEEPSEEK_API_KEY"
codewhale --version

Common failure branches

Work out which layer failed first instead of treating every problem as the same.

The app opens but the first request fails

That usually means the credential is missing, empty, or tied to the wrong provider path. Check provider setup before touching modes or MCP.

It works in one shell but fails in another

You probably have shell-specific exports or stale profile values. Compare environment variables before changing the key again.

When to leave this page

Once the route is clear, leave this page quickly. Install pages should hand you into config, config pages should send you into provider or troubleshooting, and MCP or mode pages should send you back into live workflow decisions. A detail page is valuable because it narrows the problem, not because you stay on it forever.