What is OpenAPI (and Swagger)?
Short answer
OpenAPI is a standard format — written in JSON or YAML — that describes a REST API's paths, methods, parameters, request and response schemas, and servers. Swagger is the older name and the tooling ecosystem built around it. The document lets humans and machines understand an API without reading its source code.
What OpenAPI describes
An OpenAPI document is a single JSON or YAML file that formally describes a REST API. Instead of reading code or scattered docs, a developer — or a tool — can read the spec to learn every endpoint, what it accepts, and what it returns. That machine-readable contract powers documentation sites, client code generators, mock servers, and request validators.
OpenAPI vs Swagger
Swagger was the original name of the specification. In 2015 it was donated to the OpenAPI Initiative and renamed OpenAPI, so the format is now OpenAPI (currently 3.x) while Swagger lives on as the name of popular tooling like Swagger UI and Swagger Editor. In everyday use the terms are often mixed: people say "Swagger file" when they mean an OpenAPI document.
The main parts of a document
info— title, version, and description of the APIservers— the base URLs the API is served frompaths— each endpoint, with its HTTP methods and operationscomponents— reusable schemas, parameters, and security schemessecurity— how requests authenticate, such as API keys or OAuth
Inspecting a spec safely
OpenAPI documents often describe internal or unreleased APIs, so pasting one into a hosted viewer can leak sensitive endpoint details. A local, browser-only viewer parses the document in your tab without uploading it, which lets you scan paths, methods, and schemas while the spec stays on your machine.