跳转到主要内容
POST
/
v1
/
messages
智能模型路由 (Claude 格式)
curl --request POST \
  --url https://direct.evolink.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "evolink/auto",
  "messages": [
    {
      "role": "user",
      "content": "介绍一下人工智能的发展历史"
    }
  ],
  "max_tokens": 1024,
  "temperature": 0.7,
  "top_p": 0.9,
  "top_k": 40,
  "stream": false
}
'
{
  "id": "msg_01XFDUDYJgAACyzWYzeHhsX7",
  "model": "gpt-5.4",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "人工智能的发展历史可以追溯到20世纪50年代..."
    }
  ],
  "usage": {
    "input_tokens": 15,
    "output_tokens": 156
  }
}

智能模型路由

使用 Anthropic Messages API 格式调用 EvoLink Auto 智能模型路由。

核心特点

  • Claude 原生格式:完全兼容 Anthropic Messages API
  • 智能路由:自动选择合适的模型
  • 透明返回:响应中包含实际使用的模型名称
model 参数设置为 evolink/auto,使用 /v1/messages 端点。

授权

Authorization
string
header
必填

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

获取 API Key:

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

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

请求体

application/json
model
enum<string>
必填

使用智能路由

可用选项:
evolink/auto
示例:

"evolink/auto"

messages
object[]
必填

对话消息列表

Minimum array length: 1
示例:
[
{
"role": "user",
"content": "介绍一下人工智能的发展历史"
}
]
max_tokens
integer
必填

最大生成 token 数

必填范围: x >= 1
示例:

1024

temperature
number

采样温度

必填范围: 0 <= x <= 2
示例:

0.7

top_p
number

核采样参数

必填范围: 0 <= x <= 1
示例:

0.9

top_k
integer

Top-K 采样

必填范围: x >= 1
示例:

40

stream
boolean
默认值:false

是否流式返回

响应

200 - application/json

请求成功

id
string

响应唯一标识符

model
string

实际使用的模型名称

示例:

"claude-opus-4-6"

type
enum<string>
可用选项:
message
role
enum<string>
可用选项:
assistant
content
object[]
usage
object