Agent-First HTTP

An HTTP tool for AI agents — one request in, one line of structured JSON out.

The problem: curl was built for people, not agents

Agents need to talk to the web: call an API, download a file, stream a response. The usual tool is curl, but curl was built for a person at a terminal.

Its output is text meant for human eyes. A failure is a sentence you read, not data you can branch on — and a timeout, a refused connection, and a bad URL all look different. An agent ends up scraping that text and guessing what went wrong. And because curl starts fresh every time, an agent making many calls pays the connection cost again and again.

What it does: one request, one JSON line

Agent-First HTTP makes the same web requests, but reports back in a form an agent can act on. Every request produces one JSON line. Every failure is a JSON event with a stable, named error code. Success or failure, the agent gets data — never prose.

Where to use it: API calls, streaming responses, and bursts of requests

Install

brew install agentfirstkit/tap/afhttp   # macOS / Linux
cargo install agent-first-http          # any platform

Docs