API 参考语言模型GPT-5
GPT-5 对话补全
通过 PixMind API 向 GPT-5 发起对话、工具调用与流式请求。
面向对话、工具调用、视觉理解与流式响应的前沿多模态推理模型。
提供方
OpenAI模型 ID
gpt-5请求端点
POST /v1/generations模型说明
- 按 token 计费:每次请求的 prompt 与 completion token 合并计算。
- 流式响应与非流式按相同的 token 费率计费。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 稳定的 PixMind 模型 ID,请使用 `gpt-5`。 可选值: |
messages | array | 是 | 对话消息序列,每条含 role(system、user、assistant、tool)与 content。 |
max_tokens | integer | 否 | 生成 completion token 的数量上限。 默认值: |
temperature | number | 否 | 采样温度,数值越高随机性越强。 可选值: 默认值: |
stream | boolean | 否 | 逐 token 流式返回生成内容。 可选值: 默认值: |
callback_url | string (URI) | 否 | 接收任务终态事件的 HTTPS 地址;不填写时仍可使用轮询。 |
请求示例
cURL
curl https://aihub-admin.aimix.pro/v1/generations \
-H "Authorization: Bearer $PIXMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5",
"messages": [
{
"role": "system",
"content": "You are a concise, helpful assistant."
},
{
"role": "user",
"content": "Summarize the benefits of a unified AI API platform in three points."
}
],
"max_tokens": 512,
"temperature": 0.5,
"stream": false
}'JavaScript
const response = await fetch("https://aihub-admin.aimix.pro/v1/generations", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.PIXMIND_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "gpt-5",
"messages": [
{
"role": "system",
"content": "You are a concise, helpful assistant."
},
{
"role": "user",
"content": "Summarize the benefits of a unified AI API platform in three points."
}
],
"max_tokens": 512,
"temperature": 0.5,
"stream": false
})
});
const task = await response.json();任务受理响应
生成任务为异步处理。请保存响应中的 id,并轮询 GET /v1/generations/{id},直到任务进入终态。
202 Accepted
{
"id": "img_01JXYZ...",
"model": "gpt-5",
"status": "processing"
}API 定价
| 配置 | 价格 |
|---|---|
| 输入 token | $2.50 / 1M tokens |
| 输出 token | $10.00 / 1M tokens |
API 使用 apiPlatform 角色独立计费,与 PixMind Studio 积分分开;任务受理响应中的价格快照是最终计费依据。