Skip to content

Agent

POST /v2/agent

Copy page

Start an agent run: it reads pages to answer a prompt, and cites them.

POST /v2/agent

Authentication: your key as a bearer token.

Body

FieldTypeRequiredDefault
promptstringRequired
schemaobjectOptional
strictConstrainToURLsboolean | nullOptional
threadIdstring | nullOptional
urlsstring[] | nullOptional
Firecrawl compatibility fields

Firecrawl fields DarkCrawl does not offer. It takes them so the Firecrawl SDKs keep working, then ignores or refuses each one as the table says.

FieldWhat DarkCrawl does
auditMetadataAnswers 400 NOT_IMPLEMENTED when set.
effortAccepted and ignored.
exchangeAnswers 400 NOT_IMPLEMENTED when set.
integrationAccepted and ignored.
locationAnswers 400 NOT_IMPLEMENTED when set.
maxCreditsAccepted and ignored.
modeAnswers 400 NOT_IMPLEMENTED when set.
modelAccepted and ignored.
originAccepted and ignored.
safeAnswers 400 NOT_IMPLEMENTED when set.
threatProtectionAnswers 400 NOT_IMPLEMENTED when set.
webhookAnswers 400 NOT_IMPLEMENTED when set.
zeroDataRetentionAnswers 400 NOT_IMPLEMENTED when set.

Request

bash
curl -X POST https://api.darkcrawl.dev/v2/agent \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Where did the mirror list move to?","urls":["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"]}'

Response

Status 200.

Response
{
  "success": true,
  "id": "01K0EXAMPLEJOB00000000000A",
  "threadId": "01K0EXAMPLETHREAD00000000A",
  "threadTurn": 1
}

Errors

CodeStatus
BAD_REQUEST400
NOT_IMPLEMENTED400
NOT_FOUND404
CONFLICT409
AI_UNAVAILABLE503
BLOCKLIST_UNAVAILABLE503
QUOTA_EXCEEDED402
RATE_LIMITED429

What each code means, and what to do about it: Errors.

Notes

  • The reply is the job's id, and its threadId and threadTurn. Read the job with GET /v2/agent/{job_id}.
  • Send a threadId to ask a follow-up in the same thread. A thread that is not yours or has expired is 404, and one whose last run is still going is 409.
  • A run reserves the agent's page ceiling first, and one run counts against the agent runs a day. A short grant lowers the ceiling, and warning says so. Rate limits has the limits.
  • The agent needs a model. Without one the call is 503 AI_UNAVAILABLE. See the Agent guide.