Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.q-uestionable.ai/llms.txt

Use this file to discover all available pages before exploring further.

qai recognizes a small number of environment variables. Most configuration is handled through the CLI, Settings UI, or config file — environment variables are primarily for credentials and CI/CD overrides.

LLM Provider Credentials

Provider API keys follow the convention {PROVIDER}_API_KEY. These are checked before the OS keyring when resolving credentials.
VariableProvider
ANTHROPIC_API_KEYAnthropic (Claude models)
OPENAI_API_KEYOpenAI (GPT models)
GROQ_API_KEYGroq
OPENROUTER_API_KEYOpenRouter
COHERE_API_KEYCohere
MISTRAL_API_KEYMistral
Any provider name mapped through {PROVIDER_NAME.upper()}_API_KEY is recognized. For example, a provider named azure would check AZURE_API_KEY.
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
For persistent credential storage, use the OS keyring via qai config set-credential instead of environment variables. Environment variables are useful for CI/CD pipelines and ephemeral environments where a keyring is unavailable.

Model Selection

QAI_MODEL

Default model for inject campaigns and chain execution. Used when the --model CLI flag is not provided. Format: provider/model (e.g., anthropic/claude-sonnet-4-20250514, openai/gpt-4o, ollama/llama3)
export QAI_MODEL=anthropic/claude-sonnet-4-20250514
Bare model names without a provider prefix are treated as Anthropic.

IPI Probe

QAI_PROBE_API_KEY

Bearer token for the qai ipi probe command. Used when probing OpenAI-compatible endpoints that require authentication (e.g., vLLM on RunPod with VLLM_API_KEY set).
export QAI_PROBE_API_KEY=sk-your-endpoint-key
Can also be passed directly via --api-key on the CLI. The CLI flag takes precedence over the environment variable.

Credential Resolution Order

qai resolves credentials in this order:
  1. Environment variable{PROVIDER}_API_KEY (checked first)
  2. OS keyring — stored via qai config set-credential (checked second)
  3. Error — raises if neither is found
This allows environment-based overrides for CI/CD while maintaining secure keyring storage for interactive use.

Configuration Resolution Order

For non-credential settings, qai config resolve uses this precedence:
  1. CLI flag (highest priority)
  2. Environment variable (if mapped)
  3. Database setting (stored via Settings UI or qai config set)
  4. Config file (~/.qai/config.yaml)
  5. Default value (lowest priority)
Use qai config get <key> to see the current resolved value and its source.