Skip to main content

LLM Providers

MeetLoyd supports multiple LLM providers out of the box, enabling you to choose the best model for each use case. All providers use a unified interface, making it easy to switch between models or use different providers for different agents.

Supported Providers

ProviderEnvironment VariableOfficial SDK
Anthropic (Claude)ANTHROPIC_API_KEY@anthropic-ai/sdk
OpenAI (GPT)OPENAI_API_KEYopenai
Google (Gemini)GOOGLE_API_KEYGoogle AI
MistralMISTRAL_API_KEYMistral AI
GroqGROQ_API_KEYGroq

Configuration

Set the environment variables for the providers you want to use:

# Required: At least one provider
ANTHROPIC_API_KEY=sk-ant-...

# Optional: Additional providers
OPENAI_API_KEY=sk-...
GOOGLE_API_KEY=AIza...
MISTRAL_API_KEY=...
GROQ_API_KEY=gsk_...
Multi-Provider Strategy

You don't need to configure all providers. MeetLoyd will automatically detect which providers are available based on the API keys present in your environment.

Available Models

Anthropic (Claude)

Model IDNameContextMax OutputInput CostOutput Cost
claude-opus-4-6Claude Opus 4.6200K32K$0.005/1K$0.025/1K
claude-opus-4-5-20251101Claude Opus 4.5200K32K$0.005/1K$0.025/1K
claude-sonnet-4-5-20250929Claude Sonnet 4.5200K16K$0.003/1K$0.015/1K
claude-haiku-4-5-20251015Claude Haiku 4.5200K8K$0.001/1K$0.005/1K
claude-sonnet-4-20250514Claude Sonnet 4200K8K$0.003/1K$0.015/1K
claude-3-5-sonnet-20241022Claude 3.5 Sonnet200K8K$0.003/1K$0.015/1K
claude-3-5-haiku-20241022Claude 3.5 Haiku200K8K$0.001/1K$0.005/1K

OpenAI (GPT)

Model IDNameContextMax OutputInput CostOutput Cost
gpt-5-miniGPT-5 Mini200K32K$0.002/1K$0.008/1K
gpt-4.1GPT-4.1128K32K$0.003/1K$0.012/1K
gpt-4.1-miniGPT-4.1 Mini128K16K$0.0004/1K$0.0016/1K
gpt-4oGPT-4o128K16K$0.0025/1K$0.01/1K
gpt-4o-miniGPT-4o Mini128K16K$0.00015/1K$0.0006/1K
o3o3200K100K$0.01/1K$0.04/1K
o3-minio3 Mini200K100K$0.0011/1K$0.0044/1K
o1o1200K100K$0.015/1K$0.06/1K

Google (Gemini)

Model IDNameContextMax OutputInput CostOutput Cost
gemini-2.5-proGemini 2.5 Pro1M65K$0.00125/1K$0.01/1K
gemini-2.5-flashGemini 2.5 Flash1M65K$0.00015/1K$0.0006/1K
gemini-2.0-flashGemini 2.0 Flash1M8K$0.000075/1K$0.0003/1K

Mistral

Model IDNameContextMax OutputInput CostOutput Cost
mistral-large-latestMistral Large128K8K$0.002/1K$0.006/1K
mistral-large-3-25-12Mistral Large 3 (Dec 2025)128K8K$0.002/1K$0.006/1K
mistral-small-latestMistral Small32K8K$0.0001/1K$0.0003/1K
codestral-latestCodestral256K8K$0.0003/1K$0.0009/1K
open-mistral-nemoMistral Nemo128K8K$0.00015/1K$0.00015/1K

Groq (Fast Inference)

Model IDNameContextMax OutputInput CostOutput Cost
meta-llama/llama-4-scout-17b-16e-instructLlama 4 Scout 17B128K8K$0.00011/1K$0.00034/1K
llama-3.3-70b-versatileLlama 3.3 70B128K32K$0.00059/1K$0.00079/1K
llama-3.1-8b-instantLlama 3.1 8B128K8K$0.00005/1K$0.00008/1K
mixtral-8x7b-32768Mixtral 8x7B32K32K$0.00024/1K$0.00024/1K
gemma2-9b-itGemma 2 9B8K8K$0.0002/1K$0.0002/1K

Using Models in Agents

When creating an agent, specify the model ID:

const agent = await client.agents.create({
name: 'My Agent',
model: 'claude-sonnet-4-5-20250929', // or 'gpt-4o', 'gemini-2.5-flash', etc.
systemPrompt: 'You are a helpful assistant.',
});

Model Selection Best Practices

By Use Case

Use CaseRecommended Models
Complex reasoningclaude-opus-4-5, gpt-4o, o1-preview
General tasksclaude-sonnet-4-5, gpt-4o, gemini-2.5-pro
Fast responsesclaude-haiku-4-5, gpt-4o-mini, gemini-2.5-flash
Code generationclaude-sonnet-4-5, codestral-latest, gpt-4o
Long contextgemini-2.5-pro (1M), claude-* (200K)
Cost-sensitivegpt-4o-mini, gemini-2.0-flash, llama-3.1-8b-instant
Ultra-fast inferenceGroq models (llama-*, mixtral-*)

Model Capabilities

CapabilityClaudeGPTGeminiMistralGroq
Tool UseYesYesYesYesYes
VisionYesYesYesNoNo
StreamingYesYesYesYesYes
JSON ModeYesYesYesYesYes

Model Orchestration

MeetLoyd includes intelligent model orchestration that can automatically:

  • Route tasks to the most appropriate model based on complexity
  • Fallback to alternative providers if one is unavailable
  • Track performance across models for cost optimization
import { getModelOrchestrator } from '@meetloyd/client';

const orchestrator = getModelOrchestrator();

// Automatic routing based on task type
const result = await orchestrator.execute({
taskType: 'code-generation',
messages: [{ role: 'user', content: 'Write a sorting function' }],
});

Cost Management

MeetLoyd tracks token usage and costs across all providers. View cost breakdowns in the dashboard or via API:

const usage = await client.usage.get({
startDate: '2025-01-01',
endDate: '2025-01-31',
});

console.log(usage.byModel); // Cost breakdown by model
console.log(usage.byAgent); // Cost breakdown by agent

Getting API Keys

ProviderGet Your Key
Anthropicconsole.anthropic.com
OpenAIplatform.openai.com/api-keys
Googleaistudio.google.com
Mistralconsole.mistral.ai
Groqconsole.groq.com