Skip to main content
POST
BaseURL 说明:默认 BaseURL 为 https://direct.evolink.ai,对文本模型支持更好,支持长连接;https://api.evolink.ai 是多模态主力地址,对文本模型作为备用地址使用。

授权

Authorization
string
header
必填

##所有接口均需要使用 Bearer Token 进行认证##

获取 API Key:

访问 API Key 管理页面 获取您的 API Key

使用时在请求头中添加:

请求体

application/json
model
enum<string>
默认值:kimi-k3.1-pro
必填

使用 kimi-k3.1-pro 或 kimi-k3.1-pro-highspeed;Highspeed 提供更快的生成速度。

可用选项:
kimi-k3.1-pro,
kimi-k3.1-pro-highspeed
input
必填

本次请求的输入。传字符串等价于一条 user 消息;传数组时按顺序给出带类型的 item,可包含历史对话、工具调用与工具结果。

instructions
string

顶层系统指令,作为最靠前的指令生效。

stream
boolean
默认值:false

为 true 时以 SSE 事件流返回响应。

max_output_tokens
integer
默认值:131072

最大生成 Token 数,包含思考与最终回答;默认 131072,最大 1048576,同时受剩余上下文限制。

必填范围: 1 <= x <= 1048576
reasoning
object

推理相关配置。

text
object

输出文本配置。

tools
(函数工具 · object | 自定义工具 · object | 命名空间工具 · object | 联网搜索工具 · object)[]

模型可调用的工具列表。

工具定义,按 type 区分。支持 function、custom(仅 apply_patch)、namespace 与 web_search,其他工具类型不支持。

tool_choice
enum<string>

控制工具调用行为。取 auto 时由模型自行决定是否调用工具。

可用选项:
auto
include
enum<string>[]

要额外返回的字段,仅在使用 web_search 工具时有效。web_search_call.action.sources 返回搜索命中的网页来源;web_search_call.results 返回图片搜索结果。

可用选项:
web_search_call.results,
web_search_call.action.sources
prompt_cache_options
object

上下文缓存写入选项。省略时默认自动写入 5m 缓存;写入、读取分别计费。

响应

响应创建成功

一次模型响应。

id
string

响应的唯一标识符。

示例:

"resp_68f0c1c2d3e4f5a6b7c8d9e0"

object
enum<string>
可用选项:
response
created_at
integer

响应创建时的 Unix 时间戳。

completed_at
integer | null

响应结束时的 Unix 时间戳。status 为 completed 或 incomplete 时给出,为 in_progress 或 failed 时是 null。

status
enum<string>

响应状态。流式的起手快照为 in_progress。

可用选项:
in_progress,
completed,
incomplete,
failed
model
string

产生本次响应的模型。

output
(推理 · object | 消息 · object | 函数调用 · object | 自定义工具调用 · object | 联网搜索调用 · object)[]

输出 item 数组,顺序为 web_search_call(如有)、reasoning、message、工具调用。

output 数组的元素,按 type 区分。

usage
object | null

input_tokens 包含缓存读写,普通输入需扣除 cached_tokens 和 cache_write_tokens;output_tokens 已包含思考。

incomplete_details
object | null

status 为 incomplete 时给出原因。

error
object | null

status 为 failed 时给出错误信息。

instructions
string | null
reasoning
object | null
text
object | null
tools
(函数工具 · object | 自定义工具 · object | 命名空间工具 · object | 联网搜索工具 · object)[] | null

工具定义,按 type 区分。支持 function、custom(仅 apply_patch)、namespace 与 web_search,其他工具类型不支持。

tool_choice
enum<string> | null

控制工具调用行为。取 auto 时由模型自行决定是否调用工具。

可用选项:
auto
max_output_tokens
integer | null
temperature
number | null
top_p
number | null
parallel_tool_calls
boolean
service_tier
string | null
store
boolean

固定为 false。

background
boolean | null

固定为 false。

previous_response_id
string | null

固定为 null。

conversation
object | null

固定为 null。

prompt_cache_options
object

服务端实际应用的上下文缓存写入选项。当请求省略 prompt_cache_options 时,以此处返回的 mode 和 ttl 为准