API Keys
import { Aside } from ‘@astrojs/starlight/components’;
All API keys are stored in ~/.ptah/settings.json and encrypted with your OS keychain (see Global Settings → Encryption of secrets). You can paste them through the UI under Settings → Providers, or edit the file directly.
Provider cheat sheet
Section titled “Provider cheat sheet”| Provider | Where to get a key | Config key |
|---|---|---|
| Claude | console.anthropic.com → API Keys | providers.claude.apiKey |
| Copilot | GitHub account → Copilot settings (see Copilot CLI docs) | providers.copilot.apiKey |
| Codex | Your Codex provider dashboard | providers.codex.apiKey |
| Gemini | aistudio.google.com → Get API key | providers.gemini.apiKey |
| Ollama | No key required — set baseUrl to your local server | providers.ollama.baseUrl |
| OpenRouter | openrouter.ai → Keys | providers.openrouter.apiKey |
Web-search providers
Section titled “Web-search providers”| Provider | Where to get a key | Config key |
|---|---|---|
| Tavily | tavily.com → Dashboard | webSearch.tavily.apiKey |
| Serper | serper.dev → API Keys | webSearch.serper.apiKey |
| Exa | exa.ai → Keys | webSearch.exa.apiKey |
Verifying a key
Section titled “Verifying a key”After saving, open a new chat and watch the status strip at the bottom of the window. A green dot next to the provider name means the key authenticated successfully. A red dot means the provider rejected the key — see Troubleshooting → Provider errors.
Rotating a key
Section titled “Rotating a key”- Generate a new key on the provider’s dashboard.
- Paste it into Settings → Providers → [Provider] → API key.
- Revoke the old key on the dashboard.
Ptah picks up the new key immediately — no restart required.
Removing a key
Section titled “Removing a key”Click the trash icon next to the key field, or delete the apiKey entry from settings.json. The provider will be marked unavailable in the chat UI until a key is restored.