Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Providers

A provider is an LLM backend. GHOST supports multiple providers and lets you define named model aliases.

Available Providers

ProviderIDAuth
OpenRouteropenrouterOPENROUTER_API_KEY env var
Kimi Codekimi_codeKIMI_API_KEY env var
OpenAI OAuth (Codex)openai_oauthghost auth codex

Model Aliases

Define aliases in config.toml to name your models:

[models]
default = "primary"

[models.primary]
provider = "openrouter"
model = "anthropic/claude-sonnet-4"
context_window = 200000

[models.fast]
provider = "kimi_code"
model = "kimi-k2.5"
context_window = 250000
  • default — which alias to use when none is specified
  • provider — one of: openrouter, kimi_code, openai_oauth
  • model — the model ID as the provider expects it
  • context_window — max tokens (used for compaction decisions)
  • headers (optional) — extra HTTP headers for the provider

Multiple Models

Different features can use different models:

  • Chat sessions use the default model
  • Jobs specify their own model alias in frontmatter
  • Agents can override the model in their definition

OpenAI OAuth Setup

# Authenticate with OpenAI (browser-based OAuth flow)
ghost auth codex

# Check status
ghost auth status

# Revoke tokens
ghost auth revoke