Why Publish openapi.json for Agent Discovery?
Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team
The short answer: Because hand-integration does not scale. An openapi.json describes your endpoints — every path, parameter, request and response schema, and the authentication scheme — in the standard OpenAPI format, so an agent framework can generate a working client for your store mechanically, without a human reading your docs and writing code. AXO's endpoint hints include openapi.json (and swagger, its predecessor's name) among the references its scorer looks for. Generate the file from your API's own definitions so it cannot drift, publish it at a stable URL, and link it from your developers page. Confirm discoverability in the free audit.
What is openapi.json?
openapi.json is a JSON document conforming to the OpenAPI Specification that describes an HTTP API completely: its paths and operations, parameters, request/response schemas, and security schemes. It is the machine-readable contract from which client code, documentation, and test mocks can be generated automatically.
The scaling problem it solves
Without a machine-readable description, every agent platform integrates your store the way humans integrate anything: read the docs, write a client, test, maintain. That cost is paid per store, so integrators pay it only for the largest stores — and the long tail of merchants waits for capacity that never comes. With openapi.json, the marginal cost of supporting your store collapses toward zero: the framework generates the client, and your store becomes addressable by every agent built on that framework.
This is the same economics as the product feed, one layer up: feeds made catalogues enumerable without per-store crawlers; OpenAPI makes capabilities invocable without per-store engineering. Stores that publish it are not being generous with documentation — they are buying distribution in the agent channel at the price of a generated file.
What a useful description contains
Completeness in the dimensions a client generator needs: every public path (products list and item, cart operations, order creation) with methods; parameters with types and requiredness; request bodies and response schemas that match reality (including the error shapes — an agent that cannot parse your errors cannot handle them); and the security schemes, so the generator knows how calls are authenticated.
Descriptions rot in a specific way: the hand-written file describes the API as designed, while the API evolves as implemented. The defence is generation — most frameworks emit OpenAPI from the route and schema definitions themselves, making the file a build artefact of the API rather than a parallel document. If your platform emits it, verify the emitted file's coverage once; if you generate it yourself, wire it into the build so a new endpoint without a description fails the build.
Placement and linking
Publish at a stable, guessable URL — /openapi.json at your store or API root is the convention AXO's hint list encodes — and link it from the developers page with a sentence saying what it describes. Stable matters: frameworks cache the location, and a moved description reads as a withdrawn capability. If the API lives on a subdomain, the description lives there too, linked from the storefront's docs.
Do not gate the description itself behind the API's authentication. It contains shapes, not data; every serious API programme publishes it openly (your endpoints still authenticate every call). A description behind a login is a door labelled in a language only insiders may read — the discoverability failure this guide exists to prevent, one level up.
Versioning and change discipline
APIs change; descriptions make changes legible. Version the API (in path or header, per your platform's convention), keep the description for each live version published, and treat the description's diff as a changelog integrators can consume mechanically. Breaking changes announced only in prose release notes reach humans; breaking changes visible in a description diff reach pipelines, which is where agents live.
Deprecation deserves the same mechanical courtesy: mark deprecated operations in the description before removing them, with the successor named. An agent framework that can see a deprecation coming adapts in a release cycle; one that discovers a 404 in production files your store under unreliable, next to the stale-price offenders.
Security notes: what not to describe
Describe the public contract only. Internal/admin endpoints, debug surfaces, and partner-specific operations under NDA do not belong in the public file — not because the file is a vulnerability (it grants no access), but because it is a map, and you publish maps of the territory you invite people into. If your framework generates the file from all routes, add the filter that restricts it to the public surface and review the output once by eye.
The AXO fleet itself learned this pattern the hard way at the platform level: full API schemas exposed without a gate publish your entire route map to anonymous visitors. The store-level lesson is the same: publish the customer-facing contract proudly, and keep the internal map internal. Both halves are professionalism.
Verifying the description earns its points
After publishing, paste your developers page (or the page linking the file) into the free audit: the endpoints dimension credits openapi.json references among its hints. Then do the consumer's test: fetch the file, parse it, and generate or hand-trace one client call — list products — from the description alone. If the trace needs knowledge the file does not contain, the file is not finished, whatever its size.
Finally, add the file to your change checklist beside the feed: API changes ship with description changes, verified in the same deployment. A description that lags the API by one release teaches integrators to distrust it permanently; they cannot tell which parts are stale, so they assume all of it might be.
The 5-action openapi.json routine
- Generate, never hand-maintain: emit openapi.json from the API's own route and schema definitions in the build.
- Cover the public contract completely: paths, parameters, response and error schemas, security schemes.
- Publish openly at a stable URL (/openapi.json) and link it from the developers page; never gate the description.
- Filter to the public surface: no internal or admin routes in the published file.
- Version and diff it: deprecations marked mechanically; description changes ship in the same deployment as API changes.
Worked example: the description that integrated a store overnight
Example — fictional, for illustration. A mid-size pet-supply store publishes its platform-generated openapi.json and links it from a new developers page, mostly to satisfy its own audit. Within a quarter, two agent frameworks onboard the store through their standard OpenAPI ingestion — no meetings, no custom code, the store's own team learns of the second integration from the partner's launch note. The store's endpoints dimension had already risen on discoverability; now the commercial meaning of the points arrives.
The owner contrasts it with the previous year, when an integration with a single shopping platform consumed six weeks of calls and custom mapping. The description file cost an afternoon to generate, link, and verify. Distribution economics in the agent channel reward exactly this asymmetry: publish the contract once, be integrable by everyone, forever, at zero marginal cost.
Related guides and the standing invitation
Companion reading for this topic: What Agent-Facing Endpoints Does a Store Need? · What Should a Product API for Shopping Agents Return? · Why Link Developer Docs From Your Storefront Footer? · What Are agent.json and agents.json Discovery Files?.
Whatever this guide led you to change, prove it the way every guide in this series ends: re-run the free audit on the same page and compare the dimension it names, read how the audit works if a finding is unclear, and see plans if you want the full guidance report and re-audit history while you work. A change you have not re-measured is a hope, not a fix.
Sources
- OpenAPI Specification v3.1.0 — the OpenAPI Initiative's API description standard, version 3.1.0 (2021) — the format openapi.json files follow.
- How the AXO audit works — AXO documentation — AXO's own documentation of the audit engine, its five dimensions and its scoring (current as of 2026).
Frequently asked questions
What is openapi.json used for?
It is the machine-readable description of your API — paths, operations, parameters, schemas, auth — from which agent frameworks and other tools generate working clients automatically. It turns per-store hand-integration into a mechanical process.
Should openapi.json be public?
Yes — the description itself should be openly fetchable at a stable URL, conventionally /openapi.json. It documents shapes, not data, and grants no access; your endpoints still authenticate every call. Gating the description defeats its discoverability purpose.
How do I keep it accurate?
Generate it from the API's own definitions as a build artefact, and ship description changes in the same deployment as API changes. Hand-written descriptions describe the API as designed and drift from the API as implemented.
Does AXO give points for openapi.json?
It is among the endpoint references AXO's scorer scans for (openapi.json, and swagger as its legacy name). A linked, discoverable description contributes to the endpoints dimension like other published surfaces.
Should the file include internal endpoints?
No. Publish the customer-facing contract only. Filter generated output to the public surface — the file is a map of the territory you invite integrators into, and internal routes are not part of that invitation.