openai-agents-python/examples/model_providers
2026-07-28 07:57:19 +09:00
..
any_llm_auto.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
any_llm_provider.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
custom_example_agent.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
custom_example_global.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
custom_example_provider.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
litellm_auto.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
litellm_provider.py docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
README.md feat: add any-llm model support with responses-compatible routing (#2706) 2026-03-25 11:38:43 +09:00

Model provider examples

The examples in this directory show how to route models through adapter layers such as LiteLLM and any-llm. The default examples all use OpenRouter so you only need one API key:

export OPENROUTER_API_KEY="..."

Run one of the adapter examples:

uv run examples/model_providers/any_llm_provider.py
uv run examples/model_providers/any_llm_auto.py
uv run examples/model_providers/litellm_provider.py
uv run examples/model_providers/litellm_auto.py

Direct-model examples let you override the target model:

uv run examples/model_providers/any_llm_provider.py --model openrouter/openai/gpt-5.4-mini
uv run examples/model_providers/litellm_provider.py --model openrouter/openai/gpt-5.4-mini