Docs βΊ AI agents & tools
Building with AI agents
How an agent discovers, authenticates and sends orders.
The API is designed so an AI agent can integrate with Dragonfly without a human in the loop: discover it, read a machine-readable contract, test in a sandbox, and send real orders once its merchant is approved.
Point your agent here
| Resource | URL | Use |
|---|---|---|
llms.txt | api.trydragonfly.com/llms.txt | One-screen map of everything below. |
| Guide (markdown) | api.trydragonfly.com/v1/docs | Plain-text guide, ideal context for an LLM. |
| OpenAPI 3.1 | api.trydragonfly.com/v1/openapi.json | Exact request/response schemas; generate a client. |
| MCP server | api.trydragonfly.com/v1/mcp | Tools for Claude and other MCP clients. See MCP server. |
| CLI | api.trydragonfly.com/v1/cli | Shell-friendly for coding agents. See CLI. |
| API index | api.trydragonfly.com/v1 | JSON links to all of the above. |
A prompt that works
text
You can send deliveries to Dragonfly. Read https://api.trydragonfly.com/llms.txt and
https://api.trydragonfly.com/v1/openapi.json. Use the API key in DRAGONFLY_API_KEY.
For each order: POST /v1/orders with our order number as externalId, the pickup,
the dropoff (address, name, mobile phone, delivery window with a time-zone offset).
Retry on network errors with the same externalId. Report the orderId and status.Rules agents should follow
- Use
externalId= your own order number, so retries never double-book a driver. - Every stop needs a reachable
contactPhone. - Send windows as ISO 8601 with an offset (
2026-10-09T10:30:00-07:00). - On
400 VALIDATION_ERROR, readerror.details[](each entry haspathandmessage), fix those fields and resend. - Don't poll more than once a minute per order. Prefer webhooks.
- Never print or log the API key.
Sandbox first
An agent can create its own sandbox account and key in one call ("sandbox": true; see Quickstart) and exercise the full lifecycle before a human requests production access.
Something unclear or missing? Tell us.