模型列表
OpenAI 模型
OpenAI GPT 和 o 系列模型
模型列表
GPT 系列
| 模型 | 说明 | 上下文 | 端点 |
|---|---|---|---|
gpt-5.2-pro | 最新旗舰推理模型 | 128K | Responses |
gpt-4.1 | GPT-4.1 标准版 | 128K | Chat |
gpt-4o | GPT-4 多模态版 | 128K | Chat |
gpt-4-turbo | GPT-4 Turbo | 128K | Chat |
gpt-4 | GPT-4 标准版 | 8K | Chat |
gpt-3.5-turbo | GPT-3.5 Turbo | 16K | Chat |
o 系列(推理模型)
必须使用 Responses 端点
o 系列模型必须使用 /v1/responses 端点。
| 模型 | 说明 | 推理能力 | 端点 |
|---|---|---|---|
o3-pro | o3 专业版 | 最强 | Responses |
o3-mini | o3 轻量版 | 强 | Responses |
o1-pro | o1 专业版 | 强 | Responses |
o1-mini | o1 轻量版 | 中等 | Responses |
使用示例
GPT-4.1 (Chat Completions)
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://api.smai.ai/v1"
)
response = client.chat.completions.create(
model="gpt-4.1",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "解释什么是机器学习"}
]
)
print(response.choices[0].message.content)o3-pro (Responses API)
import requests
response = requests.post(
"https://api.smai.ai/v1/responses",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer sk-your-api-key"
},
json={
"model": "o3-pro",
"input": "证明勾股定理",
"reasoning": {"effort": "high"}
}
)
print(response.json())GPT-4o 多模态
GPT-4o 支持图像输入:
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://api.smai.ai/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "这张图片里有什么?"},
{
"type": "image_url",
"image_url": {"url": "https://example.com/image.jpg"}
}
]
}
]
)
print(response.choices[0].message.content)模型选择建议
| 场景 | 推荐模型 |
|---|---|
| 日常对话 | gpt-4.1 |
| 复杂推理 | o3-pro |
| 图像理解 | gpt-4o |
| 成本敏感 | gpt-3.5-turbo |
| 快速响应 | o3-mini |
