Skip to main content
Run integration tests against live LLM providers — gated by RUN_REAL_KEY_TESTS so CI stays free and fast by default.
The user sets RUN_REAL_KEY_TESTS=1; pytest runs a real agent chat against live provider keys.

How It Works

Quick Start

1

Simple Usage

Enable the gate and set your API key:
2

With Configuration

Run a single test class for one provider:

How It Works

All tests in tests/integration/test_real_api.py use a module-level skip when RUN_REAL_KEY_TESTS is unset. Accepted values: 1, true, yes (case-insensitive).

Configuration Options


Best Practices

Use minimal prompts and prefer gpt-4o-mini — real tests consume tokens and cost money.
Read keys from environment variables; store CI secrets in GitHub Secrets.
Trigger real API tests manually in GitHub Actions, not on every push.
Reuse pytest.mark.skipif on RUN_REAL_KEY_TESTS for consistent gating across modules.

CI Example


Real API Testing CLI

CLI commands for live API tests

Performance Benchmarks

Measure agent performance