Explore a New API

Explore an OpenAPI spec before production access, credentials, or a running backend are available. Get a feel for the API before committing to an integration.

Why teams use this

The real API may not be ready, or it may be the wrong place to experiment. Counterfact gives you a safe, editable server so you can start building from the contract today.

How it works

Point Counterfact at the OpenAPI spec. It generates typed TypeScript handlers for every endpoint and starts a live server immediately, with no code to write. Every route returns random, schema-valid responses by default. Use the running server, the generated types, Swagger UI, and the REPL to explore the API’s surface area safely and cheaply.

Example

npx counterfact@latest https://api.example.com/openapi.json api

Browse the API in Swagger UI at http://localhost:3100/counterfact/swagger/, or fire requests directly from the REPL:

⬣> client.get("/users/42")
{ status: 200, body: { id: 42, name: 'Alex', email: 'alex@example.com' } }

Read the generated types in api/types/ to understand exact request and response shapes before writing any integration code. Every field, parameter, and status code defined in the spec is represented there.

What you get

Keep exploring