Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Authentication

Swarmie supports OAuth and API-key authentication. The recommended starting flow is /connect inside the TUI.

OAuth via /connect

Run:

/connect

OAuth-capable providers in the built-in wizard include:

  • openai-codex
  • anthropic (subscription flow)
  • github-copilot
  • google-gemini-cli
  • google-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 | ephemeral
  • auto tries 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:

  1. Explicit override
  2. Stored OAuth/Bearer credentials
  3. Provider environment variables
  4. Stored API key credentials
  5. External CLI credential detection (Claude/Codex/Gemini/Kimi)
  6. Canonical provider-alias fallback

Switching providers/models during a session

  • Alt+P opens the model picker
  • /models opens model picker (or /models <name> to set directly)

Use /status to verify the currently active model/provider.