NewWatchdog: we re-check your site every day and email you when AI agents get blocked →
AgentsReady
Guides · As of

How to publish an OpenAPI spec AI agents can use

Publish your OpenAPI spec as a public file at a stable URL such as /openapi.json, link it from llms.txt and your API reference, and keep it generated from your code so it never drifts. Give every operation an operationId, a one-line summary, typed parameters and an example response, and describe auth in securitySchemes. An agent or coding assistant with that file can build a correct call without guessing from prose.

From our data: As of 16 Nov 2026, we found a public OpenAPI spec for 39 of the 214 software vendors in our rankings (18%), including Amplitude, Notion, Supabase, beehiiv, Cal.com and Clerk. For 47 vendors it was the single biggest gap in their score.

Why agents need the spec, not just docs

When a coding agent like Claude Code, Cursor or Codex is asked to integrate your product, it looks for a machine-readable contract first. With an OpenAPI file it knows every endpoint, parameter, type and auth method in one fetch. Without one it reads prose docs page by page and guesses, which is where wrong field names and invented endpoints come from.

The same file powers SDK generators, API clients and many MCP servers, which are often generated from an OpenAPI spec. One good spec feeds all of them.

Where to publish it

  1. A stable, public URL

    /openapi.json or /openapi.yaml on your main or API domain. No login, no bot wall, no expiring signed link.

  2. Linked from llms.txt

    Add a line like "- [OpenAPI spec](https://example.com/openapi.json): full REST API" so agents that start from llms.txt find it.

  3. Linked from the API reference

    A visible "Download OpenAPI spec" link on your docs home. Agents and people both look there.

  4. Served with the right type

    application/json or application/yaml with a 200. A catch-all route that returns your HTML shell doesn't count.

What makes a spec usable by an agent

  1. operationId on every operation

    Short and verb-first, like listContacts or createInvoice. Agents and MCP generators turn these into tool names.

  2. A summary and description

    One line on what the call does and when to use it. This text is what an agent reads to pick the right endpoint.

  3. Typed parameters and bodies

    Real schemas with required fields, enums and formats, not a bare "object".

  4. Examples

    An example request and response for the common calls. Agents copy them.

  5. Auth in securitySchemes

    Say whether it's an API key header, bearer token or OAuth, and where to get credentials.

  6. Generated from code

    FastAPI, NestJS, Django REST Framework, Spring and others can emit the spec. A hand-written file drifts.

A minimal example

Trimmed to one operation. A real spec lists every public endpoint.

{
  "openapi": "3.1.0",
  "info": { "title": "Acme API", "version": "2026-11-01" },
  "servers": [{ "url": "https://api.acme.com/v1" }],
  "components": {
    "securitySchemes": { "apiKey": { "type": "http", "scheme": "bearer" } }
  },
  "security": [{ "apiKey": [] }],
  "paths": {
    "/contacts": {
      "get": {
        "operationId": "listContacts",
        "summary": "List contacts, newest first",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer", "maximum": 100 } }
        ],
        "responses": { "200": { "description": "A page of contacts" } }
      }
    }
  }
}

Common failures

  1. The spec only exists inside the docs tool

    Many docs platforms render from a spec but never expose the file. Publish the raw file too.

  2. Behind a login

    If the spec needs a dashboard session, agents can't read it. Keep the spec public even when the API itself needs a key.

  3. One giant file with no descriptions

    Thousands of endpoints and no summaries leave an agent unable to choose. Add summaries, or split by product with links from llms.txt.

  4. Out of date

    A stale spec is worse than none, because agents trust it. Regenerate it on every release.

Vendors with a public OpenAPI spec

39 of the vendors in our rankings, from our scan on 16 Nov 2026.

VendorCategorySpec
DigitsRe-check liveaccounting softwaredigits.com/openapi.json
MistralRe-check liveAI model APIdocs.mistral.ai/openapi.yaml
Together AIRe-check liveAI model APIdocs.together.ai/openapi.yaml
xAIRe-check liveAI model APIdocs.x.ai/openapi.json
ClerkRe-check liveauth providerclerk.com/openapi.json
FusionAuthRe-check liveauth providerfusionauth.io/docs/openapi.yaml
WorkOSRe-check liveauth providerworkos.com/openapi.json
AttioRe-check liveCRMattio.com/openapi.json
CloseRe-check liveCRMdeveloper.close.com/openapi.json
CopperRe-check liveCRMdeveloper.copper.com/v1/openapi.json
AppwriteRe-check livedatabase or backend platformappwrite.io/openapi.json
ConvexRe-check livedatabase or backend platformapi.convex.dev/v1/openapi.json
NeonRe-check livedatabase or backend platformneon.com/openapi.json
NhostRe-check livedatabase or backend platformdocs.nhost.io/openapi/auth.json
SupabaseRe-check livedatabase or backend platformsupabase.com/openapi.json
TursoRe-check livedatabase or backend platformturso.tech/openapi.json
UpstashRe-check livedatabase or backend platformupstash.com/openapi.json
XataRe-check livedatabase or backend platformxata.io/openapi.json
BoldSignRe-check livee-signature toolapi.boldsign.com/swagger/v1/swagger.json
beehiivRe-check liveemail marketing platformwww.beehiiv.com/openapi.json
LoopsRe-check liveemail marketing platformloops.so/openapi.json
MailerLiteRe-check liveemail marketing platformapi.mailerlite.com/swagger.json
ResendRe-check liveemail marketing platformresend.com/openapi.yaml
BirdRe-check liveemail or SMS APIbird.com/openapi.json
TelnyxRe-check liveemail or SMS APItelnyx.com/openapi.json
InforRe-check liveERPdocs.infor.com/swagger.json
KatanaRe-check liveERPapi.katanamrp.com/v1/openapi.json
DynatraceRe-check liveobservability toolapi.dynatrace.com/openapi.json
GrafanaRe-check liveobservability toolgrafana.com/api/openapi.json
PolarRe-check livepayments platformpolar.sh/openapi.json
RazorpayRe-check livepayments platformrazorpay.com/openapi.json
AmplitudeRe-check liveproduct analytics toolamplitude.com/openapi.json
FathomRe-check liveproduct analytics toolusefathom.com/api/openapi.json
PostHogRe-check liveproduct analytics toolposthog.com/openapi.json
monday.comRe-check liveproject management toolmonday.com/openapi.json
NotionRe-check liveproject management tooldevelopers.notion.com/openapi.json
Cal.comRe-check livescheduling toolcal.com/openapi.json
GoDaddyRe-check livewebsite builderdeveloper.godaddy.com/openapi/domains-v3.json
HostingerRe-check livewebsite builderdevelopers.hostinger.com/openapi/openapi.json

Check it yourself

The first should print 200 and a JSON or YAML content type. The second shows whether your llms.txt points agents to the spec.

curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://example.com/openapi.json
curl -s https://example.com/llms.txt | grep -i openapi
Run the free check on your siteGet the full checklist

Questions

Do I need an OpenAPI spec if I have an MCP server?

Yes, if you have a public API. The MCP server covers assistants like Claude and ChatGPT; the spec covers coding agents, SDK generators and anyone building on your API directly. Many teams generate the MCP server from the spec.

OpenAPI 3.0 or 3.1?

Either works for agents. 3.1 aligns with JSON Schema, so new specs should use it.

JSON or YAML?

Either. JSON is slightly easier for tools to fetch and parse; publishing both is fine.

Does publishing the spec expose anything private?

Only what's in it. Publish the public API surface and leave internal or admin endpoints out of the public file.