Skip to content

Examples and guides for using the OpenAI API

4.9 KB
Raw Blame
# Optional explicit environment file: set GPT_LIVE_EVALS_ENV_FILE in your shell.
# Otherwise use .env in the working directory (or the source-checkout root).
# Copy this template to .env. OPENAI_API_KEY is required for live runs.
# A separate client service also requires OPENAI_CLIENT_ASSISTANT_TOKEN.
# Existing shell values override the selected .env file. CLI flags win over
# corresponding model/environment and module config.toml defaults.

# -----------------------------------------------------------------------------
# API credentials
# -----------------------------------------------------------------------------
# Used by GPT Live, the simulated caller, TTS, and the semantic judge.
OPENAI_API_KEY=

# -----------------------------------------------------------------------------
# Evaluated GPT Live assistant
# -----------------------------------------------------------------------------
# responses: GPT Live manages delegated backend reasoning and continuity.
# client: your assistant owns backend calls, memory, tools, and application state.
OPENAI_ASSISTANT_MODE=responses
# OPENAI_ASSISTANT_MODE=client

# GPT Live API endpoint, model, and built-in voice used by CRAWL, WALK, and RUN.
OPENAI_LIVE_ENDPOINT=https://api.openai.com/v1/live/sessions
# Local development only; never permits plaintext connections to remote hosts.
# OPENAI_LIVE_ALLOW_INSECURE_LOOPBACK=true
OPENAI_LIVE_MODEL=gpt-live-1
OPENAI_LIVE_VOICE=marin

# Delegated reasoning model used by the managed assistant and bundled client agent.
OPENAI_LIVE_BACKEND_MODEL=gpt-5.6-terra

# Accepted setting values: none, low, medium, high, xhigh, max.
# The selected backend model must also support the chosen effort.
OPENAI_LIVE_BACKEND_REASONING_EFFORT=none
# OPENAI_LIVE_BACKEND_REASONING_EFFORT=low
# OPENAI_LIVE_BACKEND_REASONING_EFFORT=medium
# OPENAI_LIVE_BACKEND_REASONING_EFFORT=high
# OPENAI_LIVE_BACKEND_REASONING_EFFORT=xhigh
# OPENAI_LIVE_BACKEND_REASONING_EFFORT=max

# Maximum generated backend tokens per Responses request.
OPENAI_LIVE_BACKEND_MAX_OUTPUT_TOKENS=1000

# Backend answer detail: low, medium, or high.
OPENAI_LIVE_BACKEND_VERBOSITY=low
# OPENAI_LIVE_BACKEND_VERBOSITY=medium
# OPENAI_LIVE_BACKEND_VERBOSITY=high

# -----------------------------------------------------------------------------
# Client delegation: relevant only when OPENAI_ASSISTANT_MODE=client
# -----------------------------------------------------------------------------
# Empty uses the bundled in-process client agent. Set a WebSocket URL to use a
# separately deployed agent that owns its prompts, memory, tools, and state.
OPENAI_CLIENT_ASSISTANT_ENDPOINT=
# OPENAI_CLIENT_ASSISTANT_ENDPOINT=ws://127.0.0.1:8795/ws/assistant
# Required only for a plaintext loopback service:
# OPENAI_CLIENT_ASSISTANT_ALLOW_INSECURE_LOOPBACK=true
# OPENAI_CLIENT_ASSISTANT_ENDPOINT=wss://agent.example.com/ws/assistant

# Required by both the separate service and its connector; unused in-process.
# Generate a random value with: uv run python -c 'import secrets; print(secrets.token_urlsafe(32))'
# Never reuse an OpenAI API key or put this token in the endpoint URL.
OPENAI_CLIENT_ASSISTANT_TOKEN=

# Optional additional field names to redact recursively from event traces.
# GPT_LIVE_EVALS_REDACT_FIELDS=customer_email,phone_number,reservation_code

# Optional separate API key for the bundled client agent's Responses backend.
# Leave blank to reuse OPENAI_API_KEY; third-party backends may not need it.
OPENAI_RESPONSES_API_KEY=

# -----------------------------------------------------------------------------
# RUN simulated caller
# -----------------------------------------------------------------------------
# Caller Responses model/effort are configured independently in run_harness/config.toml:
# [simulation] simulator_backend_model = "gpt-5.6-luna", simulator_backend_reasoning_effort = "low".
# They do not inherit OPENAI_LIVE_BACKEND_* settings.
# Independent evaluator-side model that recognizes when a live conversation is over.
OPENAI_COMPLETION_MODEL=gpt-5.6-terra

# -----------------------------------------------------------------------------
# Synthetic caller audio
# -----------------------------------------------------------------------------
# TTS model for CRAWL and generated WALK recordings.
OPENAI_TTS_MODEL=gpt-4o-mini-tts

# Voice used when generating reusable WALK audio recordings.
OPENAI_WALK_TTS_VOICE=marin

# -----------------------------------------------------------------------------
# Independent semantic grading
# -----------------------------------------------------------------------------
# Separate model that judges task completion and answer quality.
OPENAI_EVAL_JUDGE_MODEL=gpt-5.6-terra

# Reasoning effort for semantic grading; higher values increase latency and cost.
OPENAI_EVAL_JUDGE_REASONING_EFFORT=medium
# OPENAI_EVAL_JUDGE_REASONING_EFFORT=none
# OPENAI_EVAL_JUDGE_REASONING_EFFORT=low
# OPENAI_EVAL_JUDGE_REASONING_EFFORT=high
# OPENAI_EVAL_JUDGE_REASONING_EFFORT=xhigh
# OPENAI_EVAL_JUDGE_REASONING_EFFORT=max