Designing REST APIs for the age of AI agents - Boyan Mihaylov - NDC Copenhagen 2026
Summary
The talk argues that REST APIs, originally designed for human developers, must fundamentally adapt to serve AI agents and LLMs as primary consumers. To ensure reliability and discoverability in an AI-driven world, API designers must focus on structured documentation (OpenAPI), robust error handling, maintaining consistency, implementing adaptive rate limiting, and considering new standards like the Model Context Protocol (MCP) for web integration.
Key takeaways
-
AI Agents are a New Consumer
21:45
The rise of AI tools means that API consumers are shifting from human developers to autonomous agents. These agents will interact with APIs by generating requests and chaining calls, requiring the API to be machine-readable and reliable.
-
Documentation is Critical for AI
26:45
The OpenAPI standard (JSON or YAML specification) is crucial. Beyond simply documenting endpoints, developers must add rich metadata about the API's purpose, constraints, and potential errors to minimize agent hallucination.
-
Prioritize Error Handling
30:30
Instead of basic validation messages, provide detailed error information (e.g., specifying the problematic field and supported options) to allow AI agents to self-correct and retry requests effectively.
-
Adopt Adaptive Rate Limiting
35:05
Traditional static rate limiting (e.g., fixed quotas per minute) is insufficient for unpredictable AI agent traffic. Implement adaptive strategies that analyze traffic patterns and adjust limits dynamically to maintain service availability.
-
Consider Web MCP
40:05
For web-based services, the Model Context Protocol (MCP) is an emerging standard allowing a webpage itself to expose tools and workflows directly to AI agents, making the entire page functional rather than just relying on backend APIs.
Technical details
-
API Evolution (REST vs. SOAP)
320s
The shift from XML-based protocols like SOAP to JSON/JavaScript-friendly REST APIs was driven by the need for easier data handling in dynamic web browsers.
-
OpenAPI Specification
1605s
This is the standard JSON or YAML format used to define a web service's capabilities, including endpoints, required inputs (schemas), and expected outputs. It is essential for machine understanding.
-
Idempotency
1950s
Operations must be designed to be repeatable without causing unintended side effects (e.g., ensuring a banking deposit executes only once), which is critical given the unpredictable nature of AI agent retries.
-
Rate Limiting Best Practices
2050s
When implementing rate limiting, always return HTTP status code 429 (Too Many Requests) and include a `Retry-After` header to guide the client on when it can safely retry.
-
Workflow vs. Endpoints
2300s
Instead of exposing independent endpoints, structure APIs to provide a clear workflow or sequence of actions (e.g., 'get coffee' -> 'order coffee'). This is more efficient for agents than simple web scraping.
Mentioned resources
- OpenAPI Specification
- GraphQL
- Model Context Protocol (MCP)
Channel & topics
Watch on YouTube · Back to latest
This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.