Introduction
from any_llm import completion
# Using the messages format
response = completion(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "What is Python?"}],
provider="openai"
)
print(response)
# Switch providers without changing your code
response = completion(
model="claude-sonnet-4-5-20250929",
messages=[{"role": "user", "content": "What is Python?"}],
provider="anthropic"
)
print(response)Why any-llm
API Documentation
For AI Systems
Last updated