Authentication
Swarmie supports OAuth and API-key authentication. The recommended starting flow is /connect inside the TUI.
OAuth via /connect
Run:
/connectOAuth-capable providers in the built-in wizard include:
openai-codexanthropic(subscription flow)github-copilotgoogle-gemini-cligoogle-antigravity
After successful OAuth, Swarmie persists credentials and updates default provider/model selections.
API key setup
You can configure providers in ~/.swarmie/config.toml (or project .swarmie/config.toml).
Example:
[defaults]
provider = "anthropic"
model = "sonnet"
[providers.anthropic]
type = "anthropic"
authentication = "api_key"
api_key_env = "ANTHROPIC_API_KEY"OpenAI-compatible example:
[defaults]
provider = "openai"
model = "gpt-4o"
[providers.openai]
type = "openai-compatible"
authentication = "api_key"
api_key_env = "OPENAI_API_KEY"
base_url = "https://api.openai.com/v1"Local Ollama example:
[defaults]
provider = "ollama"
model = "llama3.1"
[providers.ollama]
type = "openai-compatible"
authentication = "api_key"
base_url = "http://localhost:11434/v1"Credential storage
Credential storage mode is configurable via:
[auth]
store = "auto" # auto | keyring | file | ephemeralautotries OS keyring first and falls back to file storage.- File mode uses
~/.swarmie/auth.json.
Resolution order
At runtime, API keys/tokens are resolved in this precedence:
- Explicit override
- Stored OAuth/Bearer credentials
- Provider environment variables
- Stored API key credentials
- External CLI credential detection (Claude/Codex/Gemini/Kimi)
- Canonical provider-alias fallback
Switching providers/models during a session
Alt+Popens the model picker/modelsopens model picker (or/models <name>to set directly)
Use /status to verify the currently active model/provider.