Skip to content

Setting Up API Keys

Whittl doesn't ship with any built-in AI access. You bring your own API key (or use Ollama locally for free). This means no middleman markup, no message limits, no monthly quotas — you pay whichever provider you choose, directly, at their rates.

This page is the practical "where do I get a key and how do I add it" walkthrough. For guidance on which backend to pick, see Choosing a Backend.

Opening the keys dialog

Three ways to get to the API key settings:

  • Edit → Preferences → API Keys (menu)
  • Click the cog icon next to the backend dropdown in the chat panel
  • From the setup wizard on first launch

Each backend has its own field. Keys are stored locally in ~/.whittl/settings.json, encrypted at rest using a machine-derived Fernet key. Copying the settings file to another machine won't expose the keys — decryption requires the origin machine's unique derivation material.

Claude (Anthropic)

Getting a key

  1. Go to console.anthropic.com.
  2. Sign up / log in.
  3. Navigate to API Keys in the left sidebar.
  4. Click Create Key, name it "Whittl", and copy the key. It starts with sk-ant- and is shown only once — paste it into Whittl before closing the dialog.

Adding to Whittl

Paste into the Claude API Key field. Whittl validates the format and pings Anthropic's API to confirm the key works before saving.

What you'll pay

Claude's pricing is usage-based at Anthropic's published rates (see anthropic.com/pricing). Typical Whittl costs per operation:

  • Small modification (one edit): $0.01 - $0.05 on Sonnet
  • New app generation (single file, ~300 lines): $0.10 - $0.30 on Sonnet
  • Screenshot-to-app on Claude Opus: $0.50 - $1.50 depending on output size
  • Agent Mode autonomous task on Opus: $0.30 - $2.00 depending on how many rounds

Haiku is 10-15x cheaper across the board and handles most typical Whittl tasks well. Whittl's cost cache cuts multi-round costs by ~87% through prompt caching.

Gemini (Google)

Getting a key

  1. Go to aistudio.google.com/apikey.
  2. Sign in with a Google account.
  3. Click Create API key, select or create a Google Cloud project.
  4. Copy the key (starts with AIza...).

Gemini has a generous free tier — 2.5 Flash and 3 Flash both include free daily quotas suitable for hobbyist use. If you stay under the free quota, Whittl costs nothing on Gemini.

Adding to Whittl

Paste into the Gemini API Key field. Whittl defaults to gemini-2.5-flash which benefits from 75% pricing discount through automatic prompt caching on long sessions.

Switch the model from the dropdown next to the backend selector once you're running Gemini. For richer code generation, pick 2.5-pro (higher cost, materially better on complex apps).

DeepSeek

Getting a key

  1. Go to platform.deepseek.com.
  2. Sign up, add $5 credit minimum.
  3. Navigate to API Keys, create a key (starts with sk-).

DeepSeek is currently the cheapest tier-S backend. Typical Whittl costs: $0.005 - $0.02 per operation. Quality is strong on Python code specifically (DeepSeek's coding fine-tune is excellent for what Whittl does).

Adding to Whittl

Paste into the DeepSeek API Key field.

OpenRouter

Getting a key

  1. Go to openrouter.ai.
  2. Sign up, add credit to your account.
  3. Navigate to Keys, generate a key (starts with sk-or-).

OpenRouter is a single key that gives you access to 200+ models from every major provider (Anthropic, OpenAI, Google, Meta, Mistral, Qwen, DeepSeek, Cohere, and more). The tradeoff: OpenRouter adds a small margin on top of direct provider pricing (~5-10%). In exchange you get:

  • One bill, one key, across every model
  • Free models (Qwen3-Coder, DeepSeek R1 free, Llama 3.3) with rate limits
  • Automatic fallback routing with the openrouter/auto meta-model

Adding to Whittl

Paste into the OpenRouter API Key field. Then click the Models button next to the backend dropdown to browse the catalog with capability chips showing which models support tools, thinking, long context, and vision.

Starring favorites (click the ☆) puts them at the top of the model dropdown. For casual use, starring openrouter/auto, google/gemini-2.5-flash-lite, anthropic/claude-haiku-4-5 gets you three useful tiers at different price points with one click each.

Ollama (local, free)

Installing Ollama

  1. Go to ollama.com and download for your OS.
  2. Run the installer.
  3. In a terminal, pull a model: ollama pull deepseek-coder:6.7b (a good default) or ollama pull qwen2.5-coder:7b.

Telling Whittl about it

Select Ollama (Local) as the backend. Whittl auto-detects the Ollama daemon and lists installed models in its dropdown.

No API key needed. All compute is local. Free to use.

RAM and model size

A 7B-parameter model needs about 8-10 GB RAM. A 14B needs 16+ GB. Larger models (30B+) want 32 GB or a GPU. Whittl surfaces an error if the model fails to load for memory reasons; try a smaller variant.

For laptops and modest desktops: qwen2.5-coder:7b or deepseek-coder:6.7b are the sweet spot. Both handle typical Whittl tasks well.

Using multiple backends

You can configure all five and switch between them freely:

  • Primary work: whichever you picked in the setup wizard
  • Quick edits: a cheap model (DeepSeek or OpenRouter free tier)
  • Hard problems: Claude Sonnet / Opus or Gemini 2.5 Pro
  • Offline: Ollama

The dropdown in the chat panel switches backends mid-session. Your project carries forward unchanged.

Conversation history is per-session, not per-backend

Switching backends mid-conversation passes the accumulated conversation history to the new backend. This means you can start a project on Haiku (cheap), hit a hard problem, switch to Opus for one turn, then switch back to Haiku. Each backend sees the full chat context.

What's next