使用模型

在模型广场中选择模型后,可以查看该模型的接入点信息和调用示例,直接复制代码即可调用。

AI Gateway 支持多类模型和多种接口协议。接入时不要只按厂商判断地址,还需要结合模型类型和接入点的接口类型选择正确的 Endpoint。

一、查找模型接入点

进入 模型广场,点击任意模型进入详情页,可以看到:

  • 接入点管理:列出该模型可用的接入点名称、服务提供商、状态和计费信息。
  • 模型调用示例:提供 curl 和 Python 等可直接复制的代码示例。

接入点名称格式通常为

{provider}@{模型名}@{接口类型}
{provider}@{模型名}@{接口类型}

示例:

  • aliyun_bailian_bj@qwen/qwen3.7-max@open_ai
    aliyun_bailian_bj@qwen/qwen3.7-max@open_ai
    :阿里云百炼-北京,OpenAI 兼容接口。
  • volcengine_bj@doubao-seedance-2.0@task
    volcengine_bj@doubao-seedance-2.0@task
    :火山引擎 Seedance 视频任务接口。

调用前建议先确认三个信息:

  1. 模型名称。
  2. 接入点供应商。
  3. 接口类型,例如
    open_ai
    open_ai
    anthropic
    anthropic
    、视频生成、图片生成、Embedding 等。

二、Endpoint 总览

AI Gateway 目前常见调用方式如下:

模型类型适用模型 / 厂商Endpoint鉴权方式
OpenAI 兼容文本模型(除火山外)Qwen、DeepSeek、GLM、Kimi、MiniMax、腾讯 TokenHub DeepSeek 等
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/chat/completions
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/chat/completions
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
Anthropic 兼容文本模型(除火山外)接入点类型为
anthropic
anthropic
的模型
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/messages
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/messages
x-api-key: <API_KEY>
x-api-key: <API_KEY>
HappyHorse 视频生成
happyhorse-1.0-t2v
happyhorse-1.0-t2v
happyhorse-1.0-i2v
happyhorse-1.0-i2v
happyhorse-1.0-r2v
happyhorse-1.0-r2v
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/aigc/video-generation/video-synthesis
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/aigc/video-generation/video-synthesis
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
阿里文本 EmbeddingQwen Text Embedding V4 等文本向量模型
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/embeddings
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/embeddings
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
阿里多模态 Embedding
qwen3-vl-embedding
qwen3-vl-embedding
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/embeddings/multimodal-embedding/multimodal-embedding
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/embeddings/multimodal-embedding/multimodal-embedding
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
火山文本 / 视觉理解模型Doubao 文本、代码、翻译、视觉理解等
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/chat/completions
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/chat/completions
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
火山 Seedream 图片生成
doubao-seedream-5.0-lite
doubao-seedream-5.0-lite
doubao-seedream-4.5
doubao-seedream-4.5
doubao-seedream-4.0
doubao-seedream-4.0
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/images/generations
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/images/generations
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
火山 Seedance 视频生成
doubao-seedance-2.0
doubao-seedance-2.0
doubao-seedance-2.0-fast
doubao-seedance-2.0-fast
doubao-seedance-1.5-pro
doubao-seedance-1.5-pro
doubao-seedance-1.0-pro
doubao-seedance-1.0-pro
doubao-seedance-1.0-pro-fast
doubao-seedance-1.0-pro-fast
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
火山多模态 Embedding
doubao-embedding-vision
doubao-embedding-vision
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/embeddings/multimodal
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/embeddings/multimodal
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>
火山 3D 生成
doubao-seed3d-2.0
doubao-seed3d-2.0
Hyper3d-Gen2
Hyper3d-Gen2
Hitem3d-2.0
Hitem3d-2.0
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks
https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks
Authorization: Bearer <API_KEY>
Authorization: Bearer <API_KEY>

注意:

  • Endpoint 地址因部署区域不同而不同,请以模型广场详情页的实际示例代码为准。
  • 文本模型需要区分 OpenAI 兼容和 Anthropic 兼容两种协议。
  • HappyHorse 和 Qwen3 VL Embedding 属于服务化接口,路径中包含
    /gateway/api/v1/services/...
    /gateway/api/v1/services/...
  • 火山模型多使用
    /gateway/api/v3/...
    /gateway/api/v3/...

三、curl 调用

OpenAI 兼容接口

适用于 Qwen、DeepSeek、GLM、Kimi、MiniMax、腾讯 TokenHub DeepSeek 等非火山文本模型。

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3.7-max", "messages": [ {"role": "user", "content": "hello"} ] }'

Anthropic 兼容接口

适用于 Claude 系列,或接入点类型为

anthropic
anthropic
的模型。

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/messages \ -H "x-api-key: $API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-opus-4.6", "messages": [ {"role": "user", "content": "hello"} ], "max_tokens": 256 }'

HappyHorse 视频生成

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/aigc/video-generation/video-synthesis \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0-t2v", "input": { "prompt": "生成一段 5 秒视频:白色数据流穿过现代办公室,最终汇聚成 AI Gateway 标识。" } }'

阿里文本 Embedding

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/embeddings \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/text-embedding-v4", "input": "AI Gateway 可以统一管理模型调用、路由和用量统计。", "encoding_format": "float" }'

Qwen3 VL Embedding

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v1/services/embeddings/multimodal-embedding/multimodal-embedding \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3-vl-embedding", "input": [ { "type": "image_url", "image_url": {"url": "https://example.com/product.png"} }, { "type": "text", "text": "商品主图" } ] }'

火山 Doubao 文本模型

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seed-2.0-pro", "messages": [ {"role": "user", "content": "请介绍 AI Gateway 的作用"} ], "stream": false }'

火山 Seedream 图片生成

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/images/generations \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-4.0", "prompt": "一张现代数据平台控制台的产品插画,干净、专业、科技感", "size": "1024x1024", "n": 1 }'

火山 Seedance 视频生成

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.0", "content": [ { "type": "text", "text": "生成一段 5 秒视频:数据流在城市夜景中汇聚成智能中枢。" } ] }'

火山多模态 Embedding

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/embeddings/multimodal \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-embedding-vision", "input": [ { "type": "image_url", "image_url": {"url": "https://example.com/product.png"} }, { "type": "text", "text": "商品主图" } ] }'

火山 3D 生成

curl -X POST https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3/contents/generations/tasks \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seed3d-2.0", "content": [ { "type": "text", "text": "生成一个低多边形风格的科技感机器人 3D 模型。" } ] }'

四、Python 调用

OpenAI 兼容接口

使用

openai
openai
库,将
base_url
base_url
指向 AI Gateway endpoint:

from openai import OpenAI client = OpenAI( base_url="https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1", api_key="<your-api-key>", ) response = client.chat.completions.create( model="qwen/qwen3.7-max", messages=[{"role": "user", "content": "hello"}], ) print(response.choices[0].message.content)

火山 Doubao 文本模型

火山 Doubao 文本模型同样可以使用 OpenAI SDK,但

base_url
base_url
需要指向火山专用路径:

from openai import OpenAI client = OpenAI( base_url="https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/api/v3", api_key="<your-api-key>", ) response = client.chat.completions.create( model="doubao-seed-2.0-pro", messages=[{"role": "user", "content": "hello"}], ) print(response.choices[0].message.content)

Anthropic 兼容接口

可以使用

requests
requests
直接调用 Anthropic Messages 接口:

import requests url = "https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1/messages" headers = { "x-api-key": "<your-api-key>", "anthropic-version": "2023-06-01", "Content-Type": "application/json", } payload = { "model": "anthropic/claude-opus-4.6", "messages": [{"role": "user", "content": "hello"}], "max_tokens": 256, } resp = requests.post(url, headers=headers, json=payload, timeout=60) print(resp.status_code) print(resp.text)

也可以使用

anthropic
anthropic
官方 SDK,将
base_url
base_url
替换为 AI Gateway 的地址:

import anthropic client = anthropic.Anthropic( base_url="https://cn-shanghai-alicloud-aimesh.api.clickzetta.com/gateway/v1", api_key="<your-api-key>", ) message = client.messages.create( model="anthropic/claude-opus-4.6", max_tokens=256, messages=[{"role": "user", "content": "hello"}], ) print(message.content)

五、注意事项

  • Endpoint 地址因部署区域不同而不同,以模型广场中的实际示例代码为准。
  • OpenAI 兼容接口使用
    Authorization: Bearer <API_KEY>
    Authorization: Bearer <API_KEY>
  • Anthropic 兼容接口使用
    x-api-key: <API_KEY>
    x-api-key: <API_KEY>
    ,并需要设置
    anthropic-version
    anthropic-version
  • 模型名称需与模型广场接入点中的模型标识完全一致。
  • API Key 需提前在 API KEY 管理 中创建,并开启对应模型的调用权限。
  • 火山文本、图片、视频、3D、多模态 Embedding 均使用
    /gateway/api/v3/...
    /gateway/api/v3/...
  • 非火山文本 OpenAI / Anthropic 协议使用
    /gateway/v1/...
    /gateway/v1/...
  • 非火山服务化接口,例如 HappyHorse、Qwen3 VL Embedding,使用
    /gateway/api/v1/services/...
    /gateway/api/v1/services/...
  • 视频、图片、3D 等生成类任务可能返回异步任务 ID,任务状态和查询方式以模型详情页示例为准。

七、相关文档

联系我们
预约咨询
微信咨询
电话咨询
邮件咨询