Steps toward great agent experience every API provider can take today

Kevin Whinnery

Head of Marketing & DevRel

Jump to section

Jump to section

Jump to section

It is hard to communicate how much programming has changed due to AI in the last 2 months […] The leverage achievable via top tier "agentic engineering" feels very high right now.

— Andrej Karpathy, co-founder OpenAI, February 2026

The API provider’s guide to agent experience

Your API's next most important user isn't a human.

In February 2025, Andrej Karpathy coined the term "vibe coding" to describe the casual, prompt-driven way developers were using LLMs. A year later, after an explosion of coding capability in frontier models in December 2025, he described the AI-assisted coding practices of today as agentic engineering, a discipline where developers orchestrate AI agents that write, test, and debug code under human oversight.

Developers are adopting these tools en masse. A JetBrains survey indicated 85% of their developer audience is using AI to write code. Google puts this number at 90%. 65% of staff-level and above developers are delegating tasks to agents.

If you own a public or internal API, this shift has direct implications for you. The developers creating integration code for your API are increasingly doing so through AI agents. API teams everywhere need to consider agent experience (AX) as a core part of their strategy in 2026.

This guide covers what AX is, why it matters, and the concrete steps you can take to make your API successful in a world where developers turn to AI first to generate code.

What is agent experience?

For an API provider, agent experience (AX) refers to the process by which agents discover, comprehend, implement, and autonomously operate your API. AX also includes the mechanisms used by humans to ensure that agents are aligned to purpose, operating correctly, and continuously improving.

In many respects, AX is a superset of developer experience (DX) and requires many of the same components: comprehensive documentation, consistent interfaces, clear error messages, and the right mix of connectors, integrations, and tools. But AI agents do have some distinct needs, which we’ll outline in this post.

Why AX matters for external APIs

If you run a public API like Stripe, Twilio, Cloudflare, or Google, great agent experience is a competitive advantage.

Developers are choosing tools based on how well they work with their AI coding workflow. 25% of the Y Combinator Winter 2025 cohort used AI to generate 95% of their code. When a developer asks Claude Code or Codex to integrate a payments API, the one that produces working code on the first try wins.

As agentic engineering matures, developers will expect every API they work with to be agent-friendly. The APIs that get this right will see faster adoption, lower support costs, and higher retention from AI-first development teams.

Why AX matters for internal APIs

Large organizations run on internal APIs. Whether payment processing at a fintech, inventory management at a retailer, or infrastructure provisioning at a cloud company - these APIs power the microservices that internal teams depend on every day.

Good AX for internal APIs means your engineers can use AI tools to operate your internal infrastructure effectively. Instead of reading through internal wikis and Slack threads to figure out how to use the inventory service, an engineer can ask an agent to do it.

The organizations that do this well will see compounding productivity gains, and enable fewer people to ship faster (even the CEO 😱).

Where to start: a robust API and OpenAPI spec

Before you can enable agents, you need a solid API. This isn't new advice, but it's worth restating because agents amplify both good and bad API design.

A single source of truth in OpenAPI. Your OpenAPI spec is the machine-readable contract that everything else builds on: SDKs, documentation, MCP servers, and agent skills files. If your spec is incomplete, outdated, or poorly structured, every downstream artifact will suffer.

Consistent, predictable patterns. Agents learn from patterns. If your API uses consistent naming conventions, standard HTTP methods, and predictable pagination, agents can generalize from a few examples to many endpoints. Inconsistency forces agents to handle special cases, which means more errors and more debugging turns.

Clear, specific error messages. When an agent makes a wrong API call, the error message is its primary feedback mechanism. Generic errors like 400 Bad Request give the agent nothing to work with. Detailed errors like amount must be a positive integer in cents let the agent self-correct on the next attempt. This is one of the biggest differences between APIs that work well with agents and APIs that don't.

Build great human developer interfaces first

A key insight from Stainless's research on SDK code mode is that models succeed in much the same way human developers do. They perform best when they have well-designed, well-documented APIs with idiomatic SDKs.

Idiomatic, typed SDKs. AI models are excellent at writing code. They're even better at writing code against a well-typed SDK with idiomatic design patterns. A TypeScript SDK with clear type definitions gives the model strong signals about what parameters it expects, what types they should be, and what the response will look like. This reduces errors dramatically compared to raw HTTP calls.

Comprehensive documentation. Models need both API reference docs (what each endpoint does, what parameters it takes) and narrative docs (how to accomplish common tasks, what workflows look like end-to-end). Reference docs alone aren't enough. The narrative context helps agents understand when and why to use specific endpoints, not just how.

Good examples. Just like human developers, agents learn from examples. Code samples that show real-world usage patterns give agents a head start on generating correct integration code.

Create purpose-built agent interfaces

Great human interfaces are necessary, but not sufficient. Agents also need interfaces designed specifically for how they consume and interact with APIs. Today, three key agent interfaces are emerging.

MCP servers with SDK code mode

The Model Context Protocol (MCP) has become the standard for connecting AI agents to external systems. But naive MCP implementations that expose one tool per API endpoint produce disappointing results. Tool definitions flood the context window, making each request slower and less intelligent.

SDK code mode is an approach where the MCP server exposes just two tools: a documentation search tool and a code execution tool. Instead of calling individual API tools, the agent writes TypeScript code against your SDK and the MCP server executes it in a sandbox.

This approach delivers strong results for three reasons. First, models are excellent at writing code. Second, idiomatic SDKs with good docs are easier for models to write against (just like for human developers). Third, API-specific error messages and type hints provide high-fidelity feedback that reduces debugging turns.

Stainless's benchmarks against the Increase banking API show SDK code mode achieving 98% task completeness with 95% efficiency, outperforming other MCP configurations across the board. Context usage doesn't scale with task complexity because intermediate results stay in the sandbox as variables rather than feeding back through the model.

The Stainless-generated MCP server's docs_search tool also works out of the box with agentic coding tools like Cursor, Codex, and Claude Code to produce working code samples for developers using those tools. If making developers successful with your API is important to you, this is a huge boost.

Agent skills files

Agent Skills are an emerging open standard that Anthropic originally developed and the broader ecosystem has now adopted. A skill is a folder containing a SKILL.md file with instructions, scripts, and resources that agents can discover and load on demand.

Skills solve a specific problem: agents need domain-specific context to work effectively, but that context shouldn't bloat their context window. Skills use progressive disclosure. The agent loads only the skill name and description at startup. When a task matches, it loads the full instructions. Supporting resources like scripts and reference docs load only as needed.

Claude Code, OpenAI Codex, GitHub Copilot, Cursor, and many other tools all support the standard. Cloudflare has proposed a discovery RFC that uses the /.well-known/ URI standard to make skills discoverable at predictable URLs. Stainless auto-generates SKILL.md files for your API as well.

For API providers, publishing a skill for your API means giving every developer using a compatible coding agent immediate, optimized access to your API's capabilities.

AGENTS.md files

AGENTS.md is a complementary format that the Agentic AI Foundation now stewards under the Linux Foundation. While skills are modular capabilities that agents can load on demand, AGENTS.md provides project-level context: build steps, testing conventions, code style guidelines, and architectural decisions.

For API providers, an AGENTS.md in your SDK repository helps agents understand how to work with your codebase. For internal API teams, AGENTS.md files in your service repos give agents the context they need to make correct changes. OpenAI has around a hundred (and counting) AGENTS.md files in their monorepo describing various projects and microservices.

Hedge against a rapidly changing landscape

The agent interface landscape is evolving fast. Anthropic introduced MCP in November 2024 and donated it to the Linux Foundation in December 2025. Agent Skills emerged as a standard in early 2026. The Cloudflare discovery RFC landed weeks ago. New paradigms will continue to appear.

This pace of change creates a real risk. You could invest heavily in today's approach only to watch it become obsolete within months. There are two ways to manage this risk.

Invest in the fundamentals. A well-designed API, a complete OpenAPI spec, idiomatic SDKs, and great documentation will remain valuable regardless of which agent interface standards win. These are the inputs that every future agent interface will build on.

Work with a platform that tracks the frontier. Companies like Stainless generate SDKs, documentation, and MCP servers directly from your OpenAPI spec. When new agent interface standards emerge, a platform approach means you get support for them without rebuilding from scratch. Stainless already generates SDK code mode MCP servers today. As new standards like agent skills discovery and future paradigms we can't predict emerge, a partner invested in the agentic API space can keep your agent interfaces current.

Getting started

Delivering an exceptional agent experience isn't a single project. It's an ongoing capability that compounds over time. Here's a practical starting point.

Audit your OpenAPI spec. Is it complete? Does it cover all your endpoints with accurate schemas, descriptions, and examples? This is the foundation everything else builds on.

Evaluate your SDK quality. Do you have typed, idiomatic SDKs with clear error messages? Can a model write correct code against them without extensive trial and error?

Ship an agent interface. Start with an MCP server, ideally one using SDK code mode. Publish an agent skill. Add an AGENTS.md to your SDK repo. Each of these makes your API more accessible to the growing population of AI-assisted developers.

Measure and iterate. Track how agents perform against your API. Run evals. Identify where agents struggle and fix the underlying issues, whether that's unclear documentation, missing error messages, or schema gaps.

The developers using your API are already working with AI agents. The APIs that enable those agents to succeed will win the next era of developer adoption. The time to start is now.

Originally posted

Mar 23, 2026