Saltar al contenido principal
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>"
Este endpoint crea un trabajo del agente a partir de los mensajes proporcionados y la información de la branch. El trabajo se ejecuta de forma asíncrona y devuelve una respuesta en streaming con los detalles de la ejecución y los resultados. Si una branch no existe, el agente crea una. Si los archivos se editan correctamente, al final del trabajo se crea automáticamente una solicitud de extracción en borrador.

Límites de velocidad

La API del agente tiene los siguientes límites:
  • 100 usos por proyecto de Mintlify por hora

Uso recomendado

Para obtener los mejores resultados, utiliza el hook useChat de ai-sdk para enviar solicitudes y gestionar respuestas.

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