RUN_REAL_KEY_TESTS so CI stays free and fast by default.
RUN_REAL_KEY_TESTS=1; pytest runs a real agent chat against live provider keys.
How It Works
Quick Start
How It Works
All tests intests/integration/test_real_api.py use a module-level skip when RUN_REAL_KEY_TESTS is unset. Accepted values: 1, true, yes (case-insensitive).
| Variable | Required | Purpose |
|---|---|---|
RUN_REAL_KEY_TESTS | Yes | Enables live API tests |
OPENAI_API_KEY | For OpenAI tests | Provider authentication |
ANTHROPIC_API_KEY | For Claude tests | Optional provider |
GOOGLE_API_KEY | For Gemini tests | Optional provider |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
RUN_REAL_KEY_TESTS | env | unset | Master gate — tests skipped when absent |
llm | str | "gpt-4o-mini" | Use fast models to minimise cost |
output | preset | "silent" | Suppress Rich output in tests |
Best Practices
Keep prompts short
Keep prompts short
Use minimal prompts and prefer
gpt-4o-mini — real tests consume tokens and cost money.Never commit API keys
Never commit API keys
Read keys from environment variables; store CI secrets in GitHub Secrets.
Gate CI with workflow_dispatch
Gate CI with workflow_dispatch
Trigger real API tests manually in GitHub Actions, not on every push.
CI Example
Related
Real API Testing CLI
CLI commands for live API tests
Performance Benchmarks
Measure agent performance

