Skip to main content
The gateway reads three environment variables at startup. One is required; the other two have defaults that work for local development.

Required

OPENAI_API_KEY
string
required
Your OpenAI API key. The gateway uses this key for all drafter, heavyweight, and embedding API calls. It is read once at process startup.
The gateway will refuse to start if OPENAI_API_KEY is not set. You will see the following fatal error and the process will exit immediately:
OPENAI_API_KEY environment variable is required

Optional

REDIS_URL
string
default:"localhost:6379"
Redis connection string in host:port format. Used by the semantic cache to store embeddings and cached responses.When running under Docker Compose, set this to redis:6379 to reach the Redis container by its service name. The Compose file already does this:
environment:
  - REDIS_URL=redis:6379
If cache.enabled is false in config.yaml, this variable is not read.
QDRANT_URL
string
default:"http://localhost:6333"
Qdrant HTTP URL. Used by the semantic cache to store and query vector embeddings.When running under Docker Compose, set this to http://qdrant:6333 to reach the Qdrant container by its service name. The Compose file already does this:
environment:
  - QDRANT_URL=http://qdrant:6333
If cache.enabled is false in config.yaml, this variable is not read.

Setting variables

Running locally

Export variables in your shell before starting the gateway binary:
export OPENAI_API_KEY=sk-...
export REDIS_URL=localhost:6379
export QDRANT_URL=http://localhost:6333

./draft-thinker --config config.yaml
REDIS_URL and QDRANT_URL can be omitted when running locally if Redis and Qdrant are both listening on their default ports.

Running with Docker Compose

The Compose file passes variables to the gateway container via the environment block. OPENAI_API_KEY is read from your shell environment using variable substitution:
services:
  gateway:
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - REDIS_URL=redis:6379
      - QDRANT_URL=http://qdrant:6333
Set OPENAI_API_KEY in your shell before running docker compose up:
export OPENAI_API_KEY=sk-...
docker compose up -d

Build docs developers (and LLMs) love