概述
OpenModex 通过单一 API 提供来自 6 个主要 AI 供应商的 100 多个模型。所有模型均可通过相同的 OpenAI 兼容端点访问。使用 Models API 获取实时定价和可用性信息,或使用 Compare API 并排对比模型。
OpenAI
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
gpt-4o | 128K | 通用、视觉 | Streaming, Function Calling, JSON Mode, Vision |
gpt-4o-mini | 128K | 高性价比任务 | Streaming, Function Calling, JSON Mode |
o1 | 200K | 复杂推理 | Chain-of-thought |
o3 | 200K | 高级推理 | Chain-of-thought |
gpt-4-turbo | 128K | 旧版兼容 | Streaming, Function Calling, Vision |
Anthropic
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
claude-3.5-sonnet | 200K | 代码、分析、长上下文 | Streaming, Tool Use |
claude-3-opus | 200K | 复杂任务、研究 | Streaming, Tool Use |
claude-3-haiku | 200K | 快速、高性价比 | Streaming, Tool Use |
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
gemini-2.0-flash | 1M | 速度、多模态 | Streaming, Function Calling, Vision |
gemini-1.5-pro | 2M | 长文档、分析 | Streaming, Function Calling, Vision |
gemini-1.5-flash | 1M | 速度与质量的平衡 | Streaming, Function Calling |
DeepSeek
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
deepseek-chat | 128K | 通用、节省成本 | Streaming |
deepseek-reasoner | 128K | 推理、数学、代码 | Streaming, Chain-of-thought |
Mistral
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
mistral-large | 128K | 企业级、多语言 | Streaming, Function Calling |
mistral-small | 128K | 高性价比、快速 | Streaming |
codestral | 32K | 代码生成 | Streaming |
Qwen
| 模型 | 上下文 | 最佳用途 | 功能 |
|---|---|---|---|
qwen-max | 128K | 中文语言、通用 | Streaming |
qwen2.5-72b | 128K | 开源权重、多用途 | Streaming |
qwen2.5-coder | 128K | 代码生成 | Streaming |
嵌入模型
| 模型 | 维度 | 供应商 | 最佳用途 |
|---|---|---|---|
text-embedding-3-small | 1536 | OpenAI | 高性价比嵌入 |
text-embedding-3-large | 3072 | OpenAI | 高精度嵌入 |
text-embedding-ada-002 | 1536 | OpenAI | 旧版兼容 |
选择模型
使用路由策略或参考以下快速指南:| 优先级 | 推荐 |
|---|---|
| 最便宜 | gpt-4o-mini、deepseek-chat、gemini-2.0-flash |
| 最快 | gemini-2.0-flash、gpt-4o-mini、claude-3-haiku |
| 最高质量 | gpt-4o、claude-3.5-sonnet、gemini-1.5-pro |
| 最擅长代码 | claude-3.5-sonnet、deepseek-reasoner、codestral |
| 最长上下文 | gemini-1.5-pro(2M)、gemini-2.0-flash(1M) |
| 最强推理 | o3、o1、deepseek-reasoner |
const response = await client.chat.completions.create({
model: 'auto',
messages: [{ role: 'user', content: 'Hello!' }],
routing: { strategy: 'cost_optimized' },
});
实时模型数据
获取实时定价、可用性和质量评分:# List all models with pricing
curl https://api.openmodex.com/v1/models \
-H "Authorization: Bearer omx_sk_YOUR_KEY"
# Compare specific models
curl "https://api.openmodex.com/v1/models/compare?models=openai/gpt-4o,anthropic/claude-3.5-sonnet" \
-H "Authorization: Bearer omx_sk_YOUR_KEY"