跳转到主要内容
POST
/
agent
/
job
/
{projectId}
Create agent job
curl --request POST \
  --url https://api.mintlify.com/v1/agent/job/{projectId} \
  --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 具有以下限制:
  • 每个 Mintlify 项目每小时最多 100 次调用

建议用法

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

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. Create an Admin API Key here.

Path Parameters

projectId
string
required

The ID of your project. Can be retrieved from 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