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.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.
LLM Provider Credentials
Provider API keys follow the convention{PROVIDER}_API_KEY. These are checked before the OS keyring when resolving credentials.
| Variable | Provider |
|---|---|
ANTHROPIC_API_KEY | Anthropic (Claude models) |
OPENAI_API_KEY | OpenAI (GPT models) |
GROQ_API_KEY | Groq |
OPENROUTER_API_KEY | OpenRouter |
COHERE_API_KEY | Cohere |
MISTRAL_API_KEY | Mistral |
{PROVIDER_NAME.upper()}_API_KEY is recognized. For example, a provider named azure would check AZURE_API_KEY.
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)
IPI Probe
QAI_PROBE_API_KEY
Bearer token for theqai ipi probe command. Used when probing OpenAI-compatible endpoints that require authentication (e.g., vLLM on RunPod with VLLM_API_KEY set).
--api-key on the CLI. The CLI flag takes precedence over the environment variable.
Credential Resolution Order
qai resolves credentials in this order:- Environment variable —
{PROVIDER}_API_KEY(checked first) - OS keyring — stored via
qai config set-credential(checked second) - Error — raises if neither is found
Configuration Resolution Order
For non-credential settings,qai config resolve uses this precedence:
- CLI flag (highest priority)
- Environment variable (if mapped)
- Database setting (stored via Settings UI or
qai config set) - Config file (
~/.qai/config.yaml) - Default value (lowest priority)