Skip to main content

Supported Models

The Lunar SDK supports 100+ models from 11 providers. You can call any model directly (the API chooses the best provider) or force a specific provider using the provider/model syntax.

How to Call Models

Let the API choose the best provider automatically:
from lunar import Lunar

client = Lunar()

# API automatically selects the best provider
response = client.chat.completions.create(
    model="claude-3-7-sonnet",
    messages=[{"role": "user", "content": "Hello!"}]
)

Intelligent Routing

When you call a model without specifying a provider, the API automatically selects the best available provider based on real-time data:
from lunar import Lunar

client = Lunar()

# No provider specified - API chooses the best one
response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello!"}]
)

# The API might route to Groq, Bedrock, Cerebras, or SambaNova
# based on current performance metrics

How Provider Selection Works

When multiple providers support the same model, the routing engine considers:
FactorDescription
LatencyCurrent response times from each provider
AvailabilityProvider health and uptime status
CostToken pricing differences between providers
LoadCurrent traffic and queue times
You only need to configure API keys for the providers you want to use. The routing engine will only consider providers where you have valid credentials configured.

Example: Llama Models

llama-3.3-70b is available on multiple providers. Without a prefix, the API routes intelligently:
# Intelligent routing - best provider chosen automatically
response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

# If you need a specific provider:
response = client.chat.completions.create(
    model="groq/groq-llama-3.3-70b-versatile",  # Ultra-fast inference
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

Models by Provider

OpenAI Models

Use prefix: openai/
response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

GPT-4o Series

Model IDDescription
gpt-4oLatest multimodal flagship model
gpt-4o-miniFast and cost-effective
gpt-4o-2024-05-13Specific dated version
gpt-4o-search-previewWith web search capabilities
gpt-4o-mini-search-previewMini with web search

GPT-4.1 Series

Model IDDescription
gpt-4.1Enhanced GPT-4
gpt-4.1-miniSmaller, faster variant
gpt-4.1-nanoFastest, most efficient

GPT-5 Series

Model IDDescription
gpt-5Next generation flagship
gpt-5-proProfessional tier
gpt-5-miniBalanced performance
gpt-5-nanoFast and efficient
gpt-5-chat-latestLatest chat version
gpt-5-search-apiWith search capabilities

GPT-5.1 Series

Model IDDescription
gpt-5.1Latest GPT-5 update
gpt-5.1-chat-latestLatest chat version
gpt-5.1-codexCode specialized
gpt-5.1-codex-miniCompact code model

o1 Reasoning Series

Model IDDescription
o1Advanced reasoning model
o1-miniCompact reasoning
o1-proProfessional reasoning

o3 Reasoning Series

Model IDDescription
o3Latest reasoning model
o3-miniCompact variant
o3-proProfessional tier
o3-deep-researchDeep research capabilities

o4 Series

Model IDDescription
o4-miniCompact reasoning
o4-mini-deep-researchWith deep research

Specialized Models

Model IDDescription
codex-mini-latestCode generation
computer-use-previewComputer use capabilities

Quick Reference

Provider Prefixes

ProviderPrefixExample
OpenAIopenai/openai/gpt-4o
Anthropicanthropic/anthropic/claude-sonnet-4-5
Googlegemini/gemini/gemini-2.5-pro
Mistralmistral/mistral/mistral-large-latest
DeepSeekdeepseek/deepseek/deepseek-chat
Perplexityperplexity/perplexity/sonar-pro
Groqgroq/groq/groq-llama-3.3-70b-versatile
Cerebrascerebras/cerebras/cerebras-llama-3.3-70b
SambaNovasambanova/sambanova/sambanova-llama-3.3-70b
AWS Bedrockbedrock/bedrock/amazon-nova-pro

Models with Multiple Providers

Some models are available from multiple providers. The API automatically routes to the best available provider, or you can force a specific one:
ModelAvailable Providers
claude-3-5-haikuanthropic, bedrock
claude-3-7-sonnetanthropic, bedrock
claude-3-haikuanthropic, bedrock
claude-3-opusanthropic, bedrock
claude-haiku-4-5anthropic, bedrock
claude-opus-4anthropic, bedrock
claude-sonnet-4anthropic, bedrock
claude-sonnet-4-5anthropic, bedrock
# Let API choose the best provider
response = client.chat.completions.create(
    model="claude-3-7-sonnet",
    messages=[{"role": "user", "content": "Hello!"}]
)

# Force Anthropic
response = client.chat.completions.create(
    model="anthropic/claude-3-7-sonnet",
    messages=[{"role": "user", "content": "Hello!"}]
)

# Force Bedrock
response = client.chat.completions.create(
    model="bedrock/claude-3-7-sonnet",
    messages=[{"role": "user", "content": "Hello!"}]
)

Model Selection Guidelines

Use CaseRecommended Models
Low costgpt-4o-mini, claude-3-haiku, gemini-2.0-flash-lite
Fast responsesgroq-llama-3.1-8b-instant, cerebras-llama-3.1-8b
Complex reasoningo3, claude-opus-4-5, deepseek-reasoner
Code generationgpt-5.1-codex, claude-sonnet-4-5, codestral-latest
Large contextgemini-2.5-pro (1M), claude-3-7-sonnet (200K)
Web searchsonar-pro, sonar-deep-research, gpt-4o-search-preview
Researchsonar-deep-research, o3-deep-research