Skip to content

Commit a5b1164

Browse files
committed
feat: add comprehensive OpenAI and Anthropic provider support
- Add complete OpenAI template with 35 models including GPT-5, GPT-4.1, o1/o3/o4 series, DALL-E, Whisper, TTS, and embeddings - Add comprehensive Anthropic template with 8 Claude models (Opus 4.1, Opus 4, Sonnet 4, 3.7 Sonnet, 3.5 Sonnet variants, Haiku) - Implement intelligent multi-pattern matching system via 'match' arrays for handling versioned model IDs - Add auto-configuration for unmatched API models with smart capability detection - Support template-based fallback when no API key is provided - Update configuration examples with OpenAI and Anthropic provider settings - Enhance model fetching to handle 65+ OpenAI models and 8 Anthropic models - Add comprehensive logging for matched vs auto-configured models The new matching system resolves API model ID variations (e.g., gpt-5-nano-2025-08-07 → gpt-5-nano template) while providing intelligent defaults for unknown models, significantly improving coverage and reliability.
1 parent 26eea2c commit a5b1164

20 files changed

+7742
-5136
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Thumbs.db
1818

1919
# Logs
2020
*.log
21-
samples/*.json
2221

2322
# Configuration files (may contain sensitive API keys)
2423
config/providers.toml

config/providers.toml.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,24 @@ api_url = "https://tokenflux.ai/v1/models"
5050
rate_limit = 10
5151
timeout = 30
5252

53+
[providers.openai]
54+
api_url = "https://api.openai.com/v1/models"
55+
# Option 1: Use environment variable (recommended for security)
56+
api_key_env = "OPENAI_API_KEY"
57+
# Option 2: Direct API key (not recommended for production)
58+
# api_key = "your-openai-key-here"
59+
rate_limit = 10
60+
timeout = 30
61+
62+
[providers.anthropic]
63+
api_url = "https://api.anthropic.com/v1/models"
64+
# Option 1: Use environment variable (recommended for security)
65+
api_key_env = "ANTHROPIC_API_KEY"
66+
# Option 2: Direct API key (not recommended for production)
67+
# api_key = "your-anthropic-key-here"
68+
rate_limit = 10
69+
timeout = 30
70+
5371
[providers.groq]
5472
api_url = "https://api.groq.com/openai/v1/models"
5573
# Option 1: Use environment variable (recommended for security)
@@ -73,6 +91,8 @@ timeout = 60 # Web scraping might take longer
7391
# - Vercel: Uses public AI Gateway API, no key required
7492
# - GitHub AI: Uses public model listing API, no key required
7593
# - Tokenflux: Uses public API, no key required
94+
# - OpenAI: Requires API key for access
95+
# - Anthropic: Requires API key for access
7696
# - Gemini: Optional API key for complete model list
7797
# - Groq: Requires API key for access
7898
# - DeepSeek: Uses web scraping from documentation, no key required

0 commit comments

Comments
 (0)