Skip to main content
LLM Connections let you add multiple AI provider configurations and switch between them. Each session locks to a specific connection after the first message, and workspaces can define their own default connection.

Location

LLM connections are stored in:
~/.craft-agent/config.json

How Connections Are Used

Connections resolve in this order:
  1. Session connection (locked after first message)
  2. Workspace default connection (defaults.defaultLlmConnection)
  3. Global default connection (defaultLlmConnection)
  4. First connection in the list (fallback)
Each session locks to a connection after the first message. To change connections, start a new session.

Connection Schema

{
  "slug": "anthropic-api",
  "name": "Anthropic (API Key)",
  "providerType": "anthropic",
  "authType": "api_key",
  "baseUrl": "https://api.anthropic.com",
  "defaultModel": "claude-sonnet-4-5-20250929",
  "createdAt": 1737451800000
}

Fields

FieldRequiredDescription
slugYesURL-safe identifier (e.g., anthropic-api, codex)
nameYesDisplay name shown in the UI
providerTypeYesProvider backend (see list below)
authTypeYesAuth mechanism (see list below)
baseUrlNoCustom base URL for compatible providers
modelsNoExplicit model list (used by compatible providers). Accepts provider-prefixed IDs like anthropic/claude-sonnet-4.5.
defaultModelNoDefault model for this connection
codexPathNoPath to Codex binary (OpenAI/Codex only)
awsRegionNoAWS region for Bedrock
gcpProjectIdNoGCP project for Vertex
gcpRegionNoGCP region for Vertex
createdAtYesTimestamp (ms) when created
lastUsedAtNoTimestamp (ms) when last used

providerType Values

ValueDescription
anthropicDirect Anthropic API
anthropic_compatAnthropic‑compatible endpoints (OpenRouter, Vercel AI Gateway, custom)
openaiOpenAI via Codex app‑server
openai_compatOpenAI‑compatible endpoints
bedrockAWS Bedrock
vertexGoogle Vertex AI

authType Values

ValueDescription
api_keyAPI key only
api_key_with_endpointAPI key + custom endpoint
oauthOAuth login (Claude Max / Codex / OpenAI)
iam_credentialsAWS IAM credentials (Bedrock)
service_account_fileGCP service account JSON (Vertex)
environmentUses environment variables
noneNo auth required

Examples

Anthropic (API Key)

{
  "slug": "anthropic-api",
  "name": "Anthropic (API Key)",
  "providerType": "anthropic",
  "authType": "api_key",
  "defaultModel": "claude-sonnet-4-5-20250929",
  "createdAt": 1737451800000
}

Claude Max (OAuth)

{
  "slug": "claude-max",
  "name": "Claude Max",
  "providerType": "anthropic",
  "authType": "oauth",
  "defaultModel": "claude-opus-4-6",
  "createdAt": 1737451800000
}

OpenRouter (Anthropic‑compatible)

{
  "slug": "openrouter",
  "name": "OpenRouter",
  "providerType": "anthropic_compat",
  "authType": "api_key_with_endpoint",
  "baseUrl": "https://openrouter.ai/api",
  "models": [
    "anthropic/claude-opus-4.6",
    "anthropic/claude-haiku-4.5"
  ],
  "defaultModel": "anthropic/claude-opus-4.6",
  "createdAt": 1737451800000
}

OpenRouter (OpenAI‑compatible)

{
  "slug": "openrouter-openai",
  "name": "OpenRouter (OpenAI‑compat)",
  "providerType": "openai_compat",
  "authType": "api_key_with_endpoint",
  "baseUrl": "https://openrouter.ai/api/v1",
  "models": [
    "openai/gpt-5.2-codex",
    "openai/gpt-5.1-codex-mini"
  ],
  "defaultModel": "openai/gpt-5.2-codex",
  "createdAt": 1737451800000
}

Codex / OpenAI (OAuth)

{
  "slug": "codex",
  "name": "OpenAI (Codex)",
  "providerType": "openai",
  "authType": "oauth",
  "codexPath": "/Applications/Craft Agents.app/Contents/Resources/vendor/codex/darwin-arm64/codex",
  "defaultModel": "codex-mini-latest",
  "createdAt": 1737451800000
}

Managing Connections

Connections are managed in Settings → AI:
  • Add/edit/delete connections
  • Set a global default connection
  • Validate connection status
  • Set per‑workspace defaults
If you only need a single provider, keep one connection and set it as default.