跳转到主要内容
POST
/
agent
/
job
/
{domain}
Create agent job
curl --request POST \
  --url https://api-dsc.mintlify.com/v1/agent/job/{domain} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "branch": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>"
    }
  ]
}'
"<string>"
此端点会根据提供的消息和branch信息创建一个代理任务。该任务以异步方式执行,并通过流式响应返回执行详情和结果。 如果branch不存在,代理会创建一个。若文件编辑成功,任务结束时会自动创建一个草稿拉取请求(PR;亦称“合并请求”/Merge Request)。

速率限制

Agent API 具有以下限制:
  • 每个 key 每月最多使用 10,000 次
  • 每个 Mintlify 组织每小时最多 10,000 次请求
  • 每个 IP 每天最多 10,000 次请求

建议用法

为获得最佳效果,请使用 ai-sdk 的 useChat 钩子 来发送请求并处理响应。

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. See the Assistant API Key documentation for details on how to get your API key.

Path Parameters

domain
string
required

The domain identifier from your domain.mintlify.app URL. Can be found in the top left of your dashboard.

Body

application/json
branch
string
required

The name of the Git branch that the agent should work on, will be automatically created if it doesn't exist

messages
object[]
required

A list of previous messages to provide to the agent.

Response

200 - text/plain

Agent job created successfully (streaming response). X-Session-Id Header is sent back in the response

Streaming response containing the agent job execution details and results.

I