Local-first mock server

Run a Realistic Mock API Locally

Configure your mock API in the cloud, then run requests, generated data, and local persistence on your own development machine. The CLI provides a real localhost URL for frontend and QA workflows without publishing a hosted mock endpoint.

How does a local mock API work?

The dashboard stores models and behavior settings. When the CLI starts, it authenticates, synchronizes an accessible project, builds its local routes, generates compatible data, and listens on a localhost port.

What stays in the cloud and what runs locally?

Account, workspace, project, model, endpoint, relationship, and billing configuration are cloud-managed. Express requests, mock auth, generated records, CRUD mutations, runtime controls, OpenAPI output, and SQLite storage run on your machine.

Install and start the runtime

Run the package through npx, choose a project, and use the URL printed by the process. Node.js 20.19 or a compatible newer release is required.

Shell
npx mock-api-studio-cli

# Or start by slug
npx mock-api-studio-cli start customer-portal --port 4000

Keep local CRUD state between restarts

Each project uses a SQLite database in the launch directory. Created, updated, and deleted records persist while the synchronized schema and settings remain compatible; material configuration changes can regenerate the dataset.

Use localhost from your frontend

Point the development environment at the local base URL and keep production configuration separate. The runtime exposes only configured operations.

JavaScript
const API_URL = "http://localhost:4000";
const response = await fetch(`${API_URL}/customers?page=1`);
const customers = await response.json();

Local-first privacy and team workflow

Response records and request traffic are handled by the local runtime rather than a public mock endpoint. Project configuration still synchronizes from the cloud. Team viewers can run shared projects locally, but current collaboration roles do not allow them to edit configuration.

Know when to restart

Mock API Studio does not currently live-sync a running process. Save dashboard changes, stop the CLI, and start it again. Preserve any local test data you need before accepting a schema-triggered regeneration.

Run your first local endpoint

Create a project, configure one resource, and start it through the CLI. The getting-started guide covers the complete path from account to request.

Related questions

Is the mock API publicly hosted?

No. The generated API listens locally; the cloud service manages configuration and access.

Keep exploring

Last updated September 17, 2026. Product behavior described here is verified against the current Mock API Studio runtime.