curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "用一句话解释什么是量子纠缠。"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "用一句话解释什么是量子纠缠。"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-6.1-sol', messages: [{role: 'user', content: '用一句话解释什么是量子纠缠。'}]})
};
fetch('https://direct.evolink.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://direct.evolink.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-6.1-sol',
'messages' => [
[
'role' => 'user',
'content' => '用一句话解释什么是量子纠缠。'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-CvJ2p8mQxK7nR4wS",
"object": "chat.completion",
"created": 1786705221,
"model": "gpt-6.1-sol",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "量子纠缠是指两个粒子的状态相互关联,测量其中一个会瞬间确定另一个的状态。",
"tool_calls": [
{}
]
},
"logprobs": {},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 42,
"total_tokens": 60,
"prompt_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 16
}
}
}{
"error": {
"code": 400,
"message": "Unsupported parameter: 'stop' is not supported with this model.",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/credits"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}GPT 全模型接口 - Chat Completions 完整参数
- GPT 系列文本模型的 OpenAI 兼容 Chat Completions 接口,通过
model选择具体模型(全部可选值见model参数的对照表) - 全系为推理模型,通过
reasoning_effort控制推理深度;推理 token 计入输出 token 计费 - Prompt 缓存自动生效:命中缓存的输入 token 按更低的缓存价计费
- 支持同步与流式(SSE)两种模式
- 支持文本 + 图像混合输入,以及
function工具调用 - 服务端工具(联网搜索、代码执行、文档检索、MCP)仅在 Responses 接口提供
- 注意 采样类参数(
temperature、top_p、logprobs等)各模型支持范围不同,逐参数见下方说明
GPT-6:gpt-6-sol / gpt-6-luna 默认使用 medium 推理;只有显式设置 reasoning_effort: "none" 时,才能在 Chat Completions 中使用函数工具。gpt-6-astra 与 gpt-6.1-sol 不支持 none,函数调用请使用 Responses 接口。GPT-6 的 max 档位请使用 Responses,本接口不支持。
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "用一句话解释什么是量子纠缠。"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "用一句话解释什么是量子纠缠。"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-6.1-sol', messages: [{role: 'user', content: '用一句话解释什么是量子纠缠。'}]})
};
fetch('https://direct.evolink.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://direct.evolink.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-6.1-sol',
'messages' => [
[
'role' => 'user',
'content' => '用一句话解释什么是量子纠缠。'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-6.1-sol\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话解释什么是量子纠缠。\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-CvJ2p8mQxK7nR4wS",
"object": "chat.completion",
"created": 1786705221,
"model": "gpt-6.1-sol",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "量子纠缠是指两个粒子的状态相互关联,测量其中一个会瞬间确定另一个的状态。",
"tool_calls": [
{}
]
},
"logprobs": {},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 42,
"total_tokens": 60,
"prompt_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 16
}
}
}{
"error": {
"code": 400,
"message": "Unsupported parameter: 'stop' is not supported with this model.",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/credits"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}https://direct.evolink.ai,对文本模型支持更好,支持长连接;https://api.evolink.ai 是多模态主力地址,对文本模型作为备用地址使用。function 工具调用。reasoning_effort: "none";Astra 与 6.1 Sol 的函数调用,以及 GPT-6 的 max 档位,请使用 Responses 接口。授权
##所有接口均需 Bearer Token 认证##
获取 API Key:
访问 API Key 管理页面 获取你的 API Key
添加到请求头:
Authorization: Bearer YOUR_API_KEY
请求体
要调用的模型:
| 模型 ID | 上下文窗口 | 定位 |
|---|---|---|
gpt-6.1-sol | 1,050,000 | Sol 新版,以更低成本接近 Astra 的能力(推荐) |
gpt-6-astra | 1,050,000 | 面向高难度端到端任务的旗舰推理模型 |
gpt-6-sol | 1,050,000 | 复杂编程与 Agent 工作流 |
gpt-6-luna | 1,050,000 | 高吞吐分类、抽取与成本控制 |
gpt-5.6-sol | 1,050,000 | GPT-5.6 家族,前沿推理 |
gpt-5.6-terra | 1,050,000 | GPT-5.6 家族,均衡生产 |
gpt-5.6-luna | 1,050,000 | GPT-5.6 家族,高吞吐与成本控制 |
gpt-5.5 | 400,000 | 通用推理模型 |
gpt-5.4 | 128,000 | 通用推理模型 |
gpt-5.2 | 400,000 | 通用推理模型 |
gpt-5.1 | 400,000 | 通用推理模型 |
gpt-6.1-sol, gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.2, gpt-5.1 "gpt-6.1-sol"
对话消息列表,支持多轮上下文与多模态输入。
role 可选 system / developer / user / assistant / tool。
content 可以是字符串,也可以是内容块数组。块类型支持 text(文本)、image_url(图像)两种:
"content": [ { "type": "text", "text": "这张图里有什么?" }, { "type": "image_url", "image_url": { "url": "https://example.com/photo.png", "detail": "auto" } } ]
图像
image_url.url传入图片的公网 URLimage_url也可直接写成字符串,等价于{ "url": "..." }detail控制图像解析精度,可选auto(默认)/low/high/original- 图片需能被正常下载,否则返回
400
注意 本接口的块类型与 Responses 接口不同(Responses 用 input_text / input_image),两者不可混用,写错会返回 400。
GPT-6 / GPT-5.6 显式缓存断点,放在内容块上;每次请求最多写入 4 个断点(隐式断点占 1 个)。 prompt_cache_breakpoint: {"mode": "explicit"}.
Show child attributes
Show child attributes
[ { "role": "system", "content": "你是一个简洁的助手。" }, { "role": "user", "content": "用一句话解释什么是量子纠缠。" } ]
是否以流式方式返回(SSE 事件流,以 data: [DONE] 结束)。默认 false。
false
生成的最大 token 数,包含推理 token。推荐使用 max_completion_tokens。GPT-6 兼容旧字段 max_tokens:仅传旧字段时会转换;同时传入时保留 max_completion_tokens 并移除 max_tokens。GPT-6 Astra / Sol / Luna 与 GPT-6.1 Sol 最大输出为 128,000 tokens。
2048
推理深度控制。可选值随模型不同:
| 模型 | 可选值 |
|---|---|
gpt-6-astra / gpt-6.1-sol | low、medium、high、xhigh |
gpt-6-sol / gpt-6-luna | none、low、medium、high、xhigh |
gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna / gpt-5.5 | none、low、medium、high、xhigh |
gpt-5.4 / gpt-5.2 / gpt-5.1 | low、medium、high、xhigh |
推理 token 按输出 token 计费,并计入 usage.completion_tokens_details.reasoning_tokens。
GPT-6 默认使用 medium。gpt-6-astra 与 gpt-6.1-sol 不支持 none;gpt-6-sol / gpt-6-luna 支持 none。GPT-6 的 max 档位仅在 Responses 使用。
none, low, medium, high, xhigh "medium"
回答详略程度,可选 low / medium / high。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
以下为既有模型规则(不含 GPT-6 Sol / Luna 与 GPT-6.1 Sol):
注意 gpt-6-astra、gpt-5.6-sol、gpt-5.6-terra、gpt-5.6-luna 与 gpt-5.5 支持;其余模型不支持该参数。
low, medium, high "low"
采样温度,取值 0 ~ 2,值越低输出越确定。
GPT-6:gpt-6-astra 与 gpt-6.1-sol 请省略此参数;gpt-6-sol / gpt-6-luna 仅在推理档位为 none 时可调节,其他档位请省略。省略推理档位时默认为 medium,不等于 none。
既有模型:gpt-5.5 / gpt-5.4 / gpt-5.2 / gpt-5.1 支持调节;gpt-5.6 家族只接受默认值 1。
0 <= x <= 21
核采样参数,取值 0 ~ 1。建议不要与 temperature 同时调整。
GPT-6:gpt-6-astra 与 gpt-6.1-sol 请省略此参数;gpt-6-sol / gpt-6-luna 仅在推理档位为 none 时可调节,其他档位请省略。省略推理档位时默认为 medium,不等于 none。
既有模型:gpt-5.5 / gpt-5.4 / gpt-5.2 / gpt-5.1 支持调节;gpt-5.6 家族只接受默认值 1。
0 <= x <= 11
频率惩罚,取值 -2 ~ 2。正值按 token 出现频率进行惩罚,降低重复内容的概率。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
以下为既有模型规则(不含 GPT-6 Sol / Luna 与 GPT-6.1 Sol):
注意 仅 gpt-5.4 / gpt-5.2 / gpt-5.1 支持调节;gpt-5.6 家族与 gpt-5.5 不支持调节。gpt-6-astra 只接受默认值 0,传入其他值会返回 400。
-2 <= x <= 20
存在惩罚,取值 -2 ~ 2。正值鼓励模型讨论新话题。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
以下为既有模型规则(不含 GPT-6 Sol / Luna 与 GPT-6.1 Sol):
注意 仅 gpt-5.4 / gpt-5.2 / gpt-5.1 支持调节;gpt-5.6 家族与 gpt-5.5 不支持调节。gpt-6-astra 只接受默认值 0,传入其他值会返回 400。
-2 <= x <= 20
是否返回每个输出 token 的对数概率。
GPT-6:Astra 与 6.1 Sol 不支持输出 logprobs。Sol / Luna 仅在推理档位为 none 时使用;其他档位请移除 logprobs、top_logprobs,并从 Responses 的 include 中移除 message.output_text.logprobs。
以下为既有模型规则(不含 GPT-6 Sol / Luna 与 GPT-6.1 Sol):
注意 仅 gpt-5.4 / gpt-5.2 / gpt-5.1 支持;gpt-5.6 家族与 gpt-5.5 不支持该参数。
GPT-6 Astra 与 GPT-6.1 Sol 不支持该参数。
true
每个位置返回的候选 token 数量,取值 0 ~ 20,需与 logprobs: true 同时使用。
注意 支持范围同 logprobs。
GPT-6:Astra 与 6.1 Sol 不支持输出 logprobs。Sol / Luna 仅在推理档位为 none 时使用;其他档位请移除 logprobs、top_logprobs,并从 Responses 的 include 中移除 message.output_text.logprobs。
0 <= x <= 202
生成的候选回复数量,返回 choices 数组中的多个结果。全部 token(含每个候选的输出)都会计费。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
1
随机种子。相同的种子与参数组合下,模型会尽量返回一致的结果(尽力而为,不保证完全可复现)。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
42
输出格式控制:
{"type": "text"}:默认的自由文本{"type": "json_object"}:返回合法 JSON,要求messages中出现json字样,否则返回400{"type": "json_schema", "json_schema": {...}}:按给定 JSON Schema 输出结构化结果,配合"strict": true强制贴合 schema
Show child attributes
Show child attributes
工具列表,用于 Function Calling(客户端函数调用,无按次费用)。
服务端工具(联网搜索、代码执行等)不在本接口提供,请改用 Responses 接口。
GPT-6:gpt-6-sol / gpt-6-luna 默认使用 medium 推理;只有显式设置 reasoning_effort: "none" 时,才能在 Chat Completions 中使用函数工具。gpt-6-astra 与 gpt-6.1-sol 不支持 none,函数调用请使用 Responses 接口。GPT-6 的 max 档位请使用 Responses,本接口不支持。
Show child attributes
Show child attributes
工具选择控制:"auto"(默认)/ "none" / "required",或用对象指定某个函数,如 {"type": "function", "function": {"name": "get_weather"}}。
none, auto, required 是否允许模型在一轮中并行调用多个工具。默认 true,设为 false 可强制逐个调用。
GPT-6 Sol / Luna 与 GPT-6.1 Sol:此参数的支持范围尚未确认,基础请求建议省略。
true
缓存分组键。GPT-6 / GPT-5.6 自动处理缓存路由,不需要此字段来优化路由;可为不同用户或客户使用不同键,区分缓存复用与计费。同一组需复用前缀的请求应保持键一致。较早模型可使用稳定的键帮助缓存路由。
"app-chat-v1"
终端用户标识,用于区分调用来源。
"user-1024"
GPT-6 与 GPT-5.6 的 Prompt 缓存配置。默认使用隐式断点;mode: "explicit" 只使用显式断点,没有断点时不缓存。
Show child attributes
Show child attributes
{ "ttl": "30m", "mode": "implicit" }
响应
对话生成成功(JSON 对象;stream=true 时为 SSE 事件流,以 data: [DONE] 结束)
本次对话的唯一标识
"chatcmpl-CvJ2p8mQxK7nR4wS"
响应类型
chat.completion "chat.completion"
创建时间戳
1786705221
实际使用的模型名称
"gpt-6.1-sol"
生成结果列表(长度等于请求中的 n)
Show child attributes
Show child attributes