基础 URL、请求方法和必需请求头均按当前模型的协议模板渲染。

ERNIE 5.0
baidu/ernie-5.0
A natively omni-modal model with unified understanding of text, image, audio, and video, providing a flagship foundation for full-modality capabilities.
模态
输入 / 输出价格
$0.84 / $3.28M tokens
上下文
128000
发布时间
2026-01-22
价格
| 规格 | 0 - 32K | > 32K |
|---|---|---|
| 输入 | $0.84/ M tokens | $1.4/ M tokens |
| 输出 | $3.28/ M tokens | $5.6/ M tokens |
| 缓存读 | $0/ M tokens | $0/ M tokens |
| 缓存写 | $0/ M tokens | $0/ M tokens |
快速开始
可直接粘贴运行下方示例代码。Gate.AI API 与 OpenAI 兼容,多数 SDK 只需替换 base URL;切换模型时,只需修改模型 ID。
1
Get your API key
Sign in to the Gate.AI console and create a new key under "API Keys". Keep it safe and send it via the Authorization header on every request.
前往控制台创建密钥2
Make a request
Send a POST request to the Chat Completions endpoint with a model ID and an array of messages to get a reply.
POSThttps://api.gate.ai/openai/v1/chat/completions
curl --location "https://api.gate.ai/openai/v1/chat/completions" \
--header "Authorization: Bearer {API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"model": "ernie-5.0",
"messages": [
{"role": "user", "content": "Hello"}
]
}'3
Handle the response \\\\\& streaming
By default a full JSON response is returned. Add "stream": true to the request body to receive incremental chunks over SSE.
POSThttps://api.gate.ai/openai/v1/chat/completions
curl --no-buffer --location "https://api.gate.ai/openai/v1/chat/completions" \
--header "Authorization: Bearer {API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"model": "ernie-5.0",
"messages": [
{"role": "user", "content": "Hello"}
],
"stream": true
}'端点
POSThttps://api.gate.ai/openai/v1/chat/completions
字段
值
Authorization
认证请求头,使用 Bearer {API_KEY} 格式传递 API Key
Content-Type
请求内容类型,固定为 application/json
model
Model ID; the current model is ernie-5.0
messages
Ordered array of conversation messages
stream
Whether to return the result as an SSE stream