curl --request POST \
--url https://api.tikway.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.6-terra",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Write a short bedtime story about a unicorn."
}
]
}
]
}
'{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "你好!很高兴见到你。有什么我可以帮你的吗?",
"role": "assistant"
}
}
],
"created": 1788668575,
"id": "resp_0adb07c2e5dd99b5016a9cea9f1ea887d09cf2363ffb74d438",
"model": "gpt-5.6-sol",
"object": "chat.completion",
"usage": {
"completion_tokens": 20,
"prompt_tokens": 8,
"total_tokens": 28
}
}Chat Completions
curl --request POST \
--url https://api.tikway.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.6-terra",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Write a short bedtime story about a unicorn."
}
]
}
]
}
'{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "你好!很高兴见到你。有什么我可以帮你的吗?",
"role": "assistant"
}
}
],
"created": 1788668575,
"id": "resp_0adb07c2e5dd99b5016a9cea9f1ea887d09cf2363ffb74d438",
"model": "gpt-5.6-sol",
"object": "chat.completion",
"usage": {
"completion_tokens": 20,
"prompt_tokens": 8,
"total_tokens": 28
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
用于生成回复的模型 ID,例如 gpt-5.6-sol 或 o3。
gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.4 截至当前的对话消息列表。
1Hide child attributes
Hide child attributes
消息作者角色。较新的推理模型建议用 developer 替代 system。
developer, system, user, assistant, tool, function 可选的参与者名称,用于区分同一角色下的不同参与者。
消息内容。可为字符串,或由文本、图片、音频、文件内容块组成的数组。assistant 工具调用消息中可为 null。
role 为 tool 时,本消息所响应的工具调用 ID。
role 为 assistant 时模型生成的工具调用列表。
Hide child attributes
Hide child attributes
工具调用 ID。
工具类型。
function, custom 助手的拒绝消息。
采样温度。较高值使输出更随机;通常与 top_p 二选一调整。
0 <= x <= 2核采样阈值;通常与 temperature 二选一调整。
0 <= x <= 1为每条输入生成的候选回复数量。
x >= 1是否以 SSE 流式返回增量结果。
最大生成词元数,包含可见输出与推理词元。
x >= 1已弃用,请使用 max_completion_tokens。
x >= 1频率惩罚。正值减少重复表达。
-2 <= x <= 2存在惩罚。正值鼓励模型引入新内容。
-2 <= x <= 2是否返回输出词元的对数概率。
每个输出位置返回的高概率候选词元数;需同时启用 logprobs。
0 <= x <= 20停止序列,部分新模型不支持。
输出格式配置。
Hide child attributes
Hide child attributes
输出格式类型。
text, json_object, json_schema 控制模型是否调用工具、自动选择工具或强制调用指定工具。
none, auto, required 是否允许模型并行调用多个工具。
推理强度设置,用于在速度、成本与推理深度之间权衡。
输出详细程度。
low, medium, high 用于尽力使输出可复现的随机种子。
请求的服务层级。
auto, default, flex, scale, priority, fast 是否存储该请求的输出。
指定输出类型。
text, audio 提示词缓存的稳定键。
提示词缓存保留时长。
in_memory, 24h 用于协助检测滥用行为的稳定终端用户标识,不应为直接个人身份信息。
旧版终端用户标识,建议使用 safety_identifier。
网页搜索工具配置。
Hide child attributes
Hide child attributes
搜索上下文大小。
用户大致位置,用于提高本地化搜索相关性。
Hide child attributes
Hide child attributes
响应
Chat Completions 非流式响应(chat.completion)。适用于 Apifox 的“通过 JSON 等生成 → JSON Schema”直接导入。
本次聊天补全的唯一 ID。
对象类型,固定为 chat.completion。
chat.completion 响应创建时间的 Unix 时间戳,单位为秒。
实际用于生成回复的模型 ID。
模型生成的候选回复列表。
Hide child attributes
Hide child attributes
候选回复的序号,从 0 开始。
生成结束原因:stop 为自然结束,length 为达到长度限制,tool_calls 为工具调用,content_filter 为内容过滤。
stop, length, tool_calls, content_filter, function_call, null Hide child attributes
Hide child attributes
消息作者角色,固定为 assistant。
assistant 模型生成的文本内容;工具调用时可能为 null。
模型拒绝请求时生成的说明。
回复注释,例如 URL 引用。
Hide child attributes
Hide child attributes
注释类型,例如 url_citation。
模型请求调用的工具列表。
Hide child attributes
Hide child attributes
工具调用的唯一 ID。
工具类型。
function 输出词元的对数概率信息;仅在请求启用 logprobs 时返回。
Hide child attributes
Hide child attributes
输出内容中每个词元的概率信息。
Hide child attributes
Hide child attributes
词元文本。
词元对应的 UTF-8 字节序列。
该词元的对数概率。
本次请求的词元使用统计。
Hide child attributes
Hide child attributes
输入提示词使用的词元数。
模型生成内容使用的词元数。
请求使用的词元总数。
输入词元明细。
Hide child attributes
Hide child attributes
输入中命中缓存的词元数。
输入中的音频词元数。
输入中的图片词元数。
输入中的文本词元数。
写入提示词缓存的原始词元数。
生成词元明细。
Hide child attributes
Hide child attributes
模型推理使用的词元数。
模型生成的音频词元数。
模型生成的文本词元数。
实际出现在生成结果中的预测词元数。
未出现在生成结果中的预测词元数。
实际用于处理该请求的服务层级。
模型运行的后端配置指纹。