Skip to content

Authentication

Configure credentials so SQLsaber can call an AI provider.

ProviderEnvironment variableNotes
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEYUses Platform API billing
OpenAI CodexBrowser authenticationUses a ChatGPT subscription
GoogleGOOGLE_API_KEY
GroqGROQ_API_KEY
MistralMISTRAL_API_KEY
CohereCOHERE_API_KEY
Hugging FaceHUGGINGFACE_API_KEY
xAIXAI_API_KEYRecommended model xai:grok-4.6

openai: and openai-codex: are separate providers. An OpenAI API key does not authenticate an openai-codex: model. A ChatGPT subscription does not authenticate an openai: model.

Terminal window
saber auth setup

This command:

  1. Lets you choose an AI provider
  2. Starts browser authentication for OpenAI Codex, or configures an API key for other providers
  3. Stores the resulting credentials

The default model is openai:gpt-5.6-sol. Save an OpenAI key for a fresh install, or run saber models set after you save a different provider.

To save an Anthropic key, run saber auth setup, choose Anthropic, and paste a key from the Anthropic Console. Use the same steps for the other providers.

  1. Start browser authentication:
Terminal window
saber auth setup openai-codex
  1. Complete the OpenAI Codex sign-in in your browser.

  2. Select the subscription-backed model:

Terminal window
saber models set openai-codex:gpt-5.6-sol
  1. Check the saved authentication and model:
Terminal window
saber auth status
saber models current

saber auth setup configures authentication but does not change the configured model. First-launch onboarding performs both steps when you choose OpenAI Codex.

SQLsaber stores its own OpenAI Codex credentials. It does not reuse a Codex CLI login. SQLsaber currently supports browser authentication, not device-code authentication.

Terminal window
saber auth status

The output lists configured providers, API-key sources, and the OpenAI Codex connection state.

Terminal window
saber auth reset
# Non-interactive
saber auth reset openai --yes
# Disconnect OpenAI Codex
saber auth reset openai-codex --yes

If you pass a provider, SQLsaber does not ask which one to reset. Destructive commands require confirmation in a terminal, or --yes in automation.

Resetting credentials does not change the configured model. Select another model before your next query if you reset openai-codex.

Configure several providers, then switch models with saber models set. SQLsaber stores each provider’s credentials separately.

Terminal window
export ANTHROPIC_API_KEY="your-api-key"
export OPENAI_API_KEY="your-api-key"
export GOOGLE_API_KEY="your-api-key"
export GROQ_API_KEY="your-api-key"
export MISTRAL_API_KEY="your-api-key"
export COHERE_API_KEY="your-api-key"
export HUGGINGFACE_API_KEY="your-api-key"
export XAI_API_KEY="your-api-key"

Environment variables take precedence over stored credentials.

See saber auth status and saber auth --help, or Commands.

  1. Choose a model
  2. Connect a database
  3. Run a query
  4. Use thinking and other query options