API - Building with AI agents

We've built the API so that an AI agent, whether that's a Codex or Claude-style assistant or something you've written yourself, can pick it up and run your gallery with very little help. If you're wiring the API into an agent, this is the place to start.

Everything in one read: llms.txt

Point your agent at:

https://api.digitalphotogallery.com/llms.txt

It's a plain-language brief: how to authenticate, how writes work, idempotency, identifiers, paging, rate limits and the error format, all sized to read in a single fetch. There's also /llms-full.txt, which adds the entire specification inline, so an agent can take the whole thing in at once.

Turning the spec into tools

The OpenAPI specification at /openapi.v1.yaml carries every request and response, all the limits (lengths, allowed values, ranges) and worked examples. Most agent frameworks turn that straight into tools your agent can call, so it checks a request against the same rules we do before it ever sends one.

Why it works well for agents

  • It's self-describing: GET /v1/me tells the agent what it's allowed to do.
  • It's self-correcting: a 400 names the field and the rule, so the agent can fix it and carry on.
  • It's safe to retry: idempotency keys mean a confused or interrupted agent never makes the same change twice.
  • It backs off politely: a 429 carries a Retry-After, so the agent knows how long to wait.

The one thing to get across to an agent is that writes are asynchronous. It should send the request, take the Operation it gets back, and poll that Operation to see what happened. The status is what's true, not the fact that the request was accepted.

Last updated: