---
title: "Start Agent"
method: POST
path: "/api/v1/agent"
---

# Start Agent

`POST /api/v1/agent`

## Request

- Base URL: `https://api.mesharc.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mesharc.dev/api/v1/agent`
- Auth: none declared

An agent run: a prompt (and optional URLs and JSON Schema) in, the
answer with its sources out. It searches, maps and reads pages through
the same ladder as a crawl, and charges the same way: pages as they are
read (refused pages free), model tokens at the model's price plus 20%
(or 1 per 1k tokens on your own `connectionId`); `maxCredits`
caps the run (2,000 by default). Runs in the background: 202 with `next`
to poll at GET /agent/{id}, or wait up to `timeout` seconds. With a
`webhook` the run's life is posted to it, signed with `webhookSecret`
(returned here once).

## Headers

- `authorization` string, nullable
- `x-mesharc-tenant` string, nullable

## Request body

- AgentRequest
  - `prompt` string, required
  - `urls` string[], nullable
  - `schema` object, nullable
  - `maxCredits` integer, nullable
  - `maxSteps` integer, nullable
  - `allowedDomains` string[], nullable
  - `timeout` number, nullable
  - `webhook` union
    - object
    - string
  - `connectionId` string, nullable
  - `proposals` boolean, nullable
  - `logins` union
    - string
    - string[]
  - `loginId` string, nullable
  - `dataConnections` string[], nullable

## Response `200`

Successful Response

- AgentResponse
  - `id` string, required
  - `kind` string, required
  - `status` string, required
  - `prompt` string, required
  - `params` object, required
  - `data` union
    - object
    - unknown[]
      - unknown
  - `fieldSources` object
  - `sources` AgentSource[], required
    - `url` string, required
    - `title` string
    - `pageId` string
    - `provider` string, nullable
  - `creditsUsed` integer, required
  - `budget` integer, required
  - `budgetLimited` boolean, required
  - `tokens` object, required
  - `steps` integer, required
  - `model` string, required
  - `threadId` string, required
  - `continuesRunId` string, nullable
  - `continuedBy` string, nullable
  - `followsRunId` string, nullable
  - `followedBy` string, nullable
  - `stopReason` string, required
  - `error` string, required
  - `doing` object, nullable
  - `next` string, nullable
  - `createdAt` string, nullable
  - `startedAt` string, nullable
  - `finishedAt` string, nullable
  - `expiresAt` string, nullable
  - `request_id` string, required
  - `webhookSecret` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mesharc/apis/mesharc-api.md) · [All operations](https://skmtc.dev/mesharc/apis/mesharc-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mesharc/apis/mesharc-api/revisions/d63cc02dfec2?raw)
