# Chat2Response — Example .env
# Copy this file to `.env` and adjust values for your environment.
# All values are optional unless noted. Lines starting with `#` are comments.
###############################################################################
# Server
###############################################################################
# Address the HTTP server binds to (host:port).
BIND_ADDR=0.0.0.0:8088
# Logging (tracing) configuration.
# Example levels: error,warn,info,debug,trace
RUST_LOG=info,tower_http=info
###############################################################################
# Upstream (OpenAI or compatible)
###############################################################################
# REQUIRED for /proxy to contact a real upstream.
# Do NOT commit real keys; use placeholders locally.
# OPENAI_API_KEY=sk-your-key
# Base URL for upstream API.
# Default (if unset): https://api.openai.com/v1
OPENAI_BASE_URL=https://api.openai.com/v1
# Upstream mode:
# - responses (default): forward to /responses (Responses API)
# - chat or chat-completions: rewrite upstream path to /chat/completions and
# adapt payload for Chat Completions.
UPSTREAM_MODE=responses
# Alias of UPSTREAM_MODE (either can be used; UPSTREAM_MODE takes precedence).
# CHAT2RESPONSE_UPSTREAM=responses
# Some upstreams require a top-level "input" string for non-streaming calls.
# When truthy (1,true,yes,on), derive and inject a best-effort "input".
CHAT2RESPONSE_UPSTREAM_INPUT=0
###############################################################################
# CORS (Cross-Origin Resource Sharing)
# Defaults are permissive when unset. Set explicit values for production.
###############################################################################
# Allowed origins:
# - "*" allows any origin
# - Comma-separated list: "https://a.example.com, https://b.example.com"
CORS_ALLOWED_ORIGINS=*
# Allowed HTTP methods:
# - "*" allows any method
# - Comma-separated list: "GET,POST,OPTIONS"
CORS_ALLOWED_METHODS=GET,POST,OPTIONS
# Allowed request headers:
# - "*" allows any header
# - Comma-separated list: "content-type, authorization"
CORS_ALLOWED_HEADERS=*
# Allow credentials (cookies, auth headers) — enable cautiously:
# truthy values: 1,true,yes,on
CORS_ALLOW_CREDENTIALS=0
# Preflight max-age in seconds (browser caches OPTIONS response).
CORS_MAX_AGE=600
###############################################################################
# Production CORS example (uncomment and customize)
###############################################################################
# CORS_ALLOWED_ORIGINS=https://yourapp.example.com
# CORS_ALLOWED_METHODS=GET,POST,OPTIONS
# CORS_ALLOWED_HEADERS=content-type,authorization
# CORS_ALLOW_CREDENTIALS=1
# CORS_MAX_AGE=600