Skip to content

文本 / 对话模型 ​

所有文本 / 对话模型都通过 OpenAI 兼容 的 POST /v1/chat/completions 调用,只需更换 model 字段。

基本调用 ​

python
from openai import OpenAI
client = OpenAI(api_key="sk-xxxxxxxx", base_url="https://ai.jhdataops.com/v1")

resp = client.chat.completions.create(
    model="claude-sonnet-4-6",   # 换成任意支持的模型名
    messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)

能力矩阵 ​

能力说明适用模型示例
流式输出stream=true,逐 token 返回全部
函数调用 / 工具tools 参数,Agent 必备GPT、Claude、Gemini、Qwen 等
视觉 / 多模态消息里传图片 URL / base64gpt-5.5、claude-*、gemini-*
推理 / 思考输出推理过程o 系列、deepseek-v4-pro、Claude thinking
长上下文数十万~百万 tokenGemini、Claude

视觉输入示例 ​

python
resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "这张图里有什么?"},
            {"type": "image_url", "image_url": {"url": "https://example.com/cat.jpg"}}
        ]
    }],
)

函数调用示例 ​

python
tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "查询城市天气",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
        },
    },
}]

resp = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "北京今天天气如何?"}],
    tools=tools,
)

TIP

选型建议:成本敏感用 deepseek-v4-flash / gpt-5.5;强编码 / Agent 用 claude-sonnet-4-6 / claude-opus-4-8;超长上下文用 gemini-3.1-pro-preview。

浙中TOKEN运营中心-模型广场 · 一个 API Key 接入全量大模型