Skip to content

Providers & Models

SANDCODE ships with z.ai as the default provider and GLM-5.1 as the default model. The API client is configured in src/services/api/client.ts.

Set your provider in user or project config:

{
"provider": "zai",
"model": "GLM-5.1"
}

SANDCODE checks for your API key in this order:

  1. ZAI_API_KEY environment variable
  2. Interactive prompt on first run (stored securely)
  3. apiKey field in config
Terminal window
export ZAI_API_KEY=sk-your-key-here

All models are configured in src/utils/model/configs.ts. The GLM model family includes:

ModelContext WindowNotes
GLM-5.1200KDefault, recommended
GLM-4.6128KPrevious generation

SANDCODE’s provider detection (src/utils/model/providers.ts) checks environment variables and config. You can configure custom providers by setting:

Terminal window
export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...

And updating your config:

{
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}

Context window sizes are defined in src/utils/context.ts. GLM models get 200K tokens by default.