Prism
Command-line HTTP server that mocks APIs from OpenAPI v2/v3.x and Postman Collections, and proxies traffic to validate it against the spec.
Prism is an open-source, command-line HTTP server for API mocking and contract testing. It reads an API description document (OpenAPI v2.0, formerly Swagger, OpenAPI v3.0, OpenAPI v3.1, or a Postman Collection) and serves HTTP responses based on it. It also provides request validation and content negotiation, and can run standalone or in continuous integration.
The prism mock command starts a mock server from a local file or a URL, for example prism mock https://raw.githack.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml. This lets API consumers call an API before a backend exists. The prism proxy command runs in front of a real service, for example prism proxy examples/petstore.oas2.yaml https://petstore.swagger.io/v2. It forwards HTTP traffic and reports discrepancies between the implementation and the OpenAPI document, which supports contract testing.
Some behaviors are documented in the FAQ. Prism listens on localhost by default, so inside Docker you need -h 0.0.0.0 to reach the mock server from outside the container. Prism v3 treats OAS2 host + basePath the same as OAS3 server.url, so the base path is not included in request URLs. Prism requires Node.js 18.20.1 or later. It is aimed at API developers, front-end and integration developers consuming an API, and teams adding contract checks to CI.
Installation
# via npm
npm install -g @stoplight/prism-cli
Alternatives & related tools
clasp
Command-line tool for developing Google Apps Script projects locally: push/pull code, manage versions and deployments, tail logs, and run functions.
Supabase CLI
Runs the Supabase stack locally, manages Postgres migrations, deploys Edge Functions, and generates TypeScript types from your database schema.
concurrently
Node.js CLI that runs multiple shell commands in parallel with prefixed, colored output and options to kill or restart processes. Works on Windows.
ni
Detects a project's package manager from its lockfile and translates ni, nr, nlx, nup, nun, nci commands for npm, yarn, pnpm, bun, deno, nub and aube.
serve
Node.js CLI that serves a static site, single page application, or single file over HTTP, with a browsable directory listing UI.
add a badge to your README
Maintain Prism? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/prism?utm_source=badge)<a href="https://www.trmn.sh/tools/prism?utm_source=badge"><img src="https://www.trmn.sh/badge/prism.svg" alt="Featured on trmn" height="20"></a>