API Mock Studio: a working mock API
A working mock API for frontend development and integration checks before the backend is ready. Import OpenAPI or define endpoints, set responses, delays and errors, check the contract and download a mock server.
Free, no sign-up
Project and schemas
The same seed gives the same test data, delays and errors.
One origin per line: http://localhost:3000. * — any. Empty — no CORS headers.
Named schemas for $ref: {"User": {"type": "object", …}}.
Endpoints
How the tool works
Endpoints
Import OpenAPI 3.0/3.1 as JSON or YAML, or define endpoints by hand: method, path template /users/{id}, query parameters, request body schema and responses per status — a JSON template with tokens or data generated from a schema.
Test data
The generator is deterministic: one seed, the same data. It honours type and format (email, uuid, date-time, date, uri, ipv4), enum, bounds and lengths, simple patterns, arrays, nested objects, oneOf/anyOf/allOf and nullable; example and examples win over generation. Property names hint at plausible values: name, email, phone, city, price, createdAt, avatar.
Console and log
A request is handled in the browser: routing, delay, injected error, body and parameter checks, tokens and pagination. The log shows time, method, path, endpoint, status, duration, bodies and contract violations, with filters.
Contract and export
Each response is checked against its own schema, and you can paste a real backend response to check it. Downloads: a zero-dependency mock-server.mjs, MSW v2 handlers, OpenAPI 3.1, a Markdown summary and the project JSON.
Behaviour rules
The browser console and the downloaded mock-server.mjs follow one table. MSW handlers repeat the response behaviour; request schema checks run in the console and in mock-server.mjs.
AMS-B01
- Rule
- Routing: templates match segment by segment; the most specific wins — a static segment beats a parameter, left to right (/products/featured before /products/{id}).
AMS-B02
- Rule
- Path found but not the method → 405 with an Allow header; no path → 404 listing the routes.
AMS-B03
- Rule
- The request number n for an endpoint (from zero) and the project seed give deterministic numbers: the same request order repeats the same delays and errors.
AMS-B04
- Rule
- Injected error: rand(seed, endpoint|err, n) × 100 < error rate → the error status and an X-Mock-Injected-Error header.
AMS-B05
- Rule
- Delay: fixed, or min + ⌊rand(seed, endpoint|delay, n) × (max − min + 1)⌋ ms.
AMS-B06
- Rule
- The request is checked against the body schema and query parameters; in “reject” mode a violation returns 422 with the list.
AMS-B07
- Rule
- Template tokens: {{params.id}}, {{query.page}}, {{body.email}}, {{now}}, {{seq}}; a string that is just a token keeps the value type, :number converts to a number.
AMS-B08
- Rule
- Echo: path parameter values are written into same-named fields of the response object (as numbers when the field is numeric).
AMS-B09
- Rule
- Pagination: the array is sliced by ?page= (from 1) and ?limit= (1–100, default 10); the total is in X-Total-Count.
AMS-B10
- Rule
- The X-Mock-Status: 404 header returns that status’s response for one request — handy for error screens.
Project checks
The table is generated from the same code as the checks in the tool.
AMS-E01
- Level
- error
- Check
- Invalid path template
- What to do
- Start with /, make each parameter a whole segment like {id}, do not repeat names.
AMS-E02
- Level
- error
- Check
- Two endpoints with the same method and path
- What to do
- Keep one: the second never receives a request (parameter names do not make paths different).
AMS-E03
- Level
- error
- Check
- The response body is not JSON
- What to do
- Fix the template JSON — until then the endpoint answers 500 mock_template_invalid.
AMS-E04
- Level
- error
- Check
- The schema is not JSON
- What to do
- Write the schema as a JSON object: {"type": "object", …}.
AMS-E05
- Level
- warning
- Check
- No response is defined for the active status
- What to do
- A default {error, message} body is returned. Add a response or pick another status.
AMS-E06
- Level
- warning
- Check
- The response does not match its schema
- What to do
- Fix the example or the schema: the frontend would be built against a wrong contract.
AMS-E07
- Level
- warning
- Check
- A $ref points nowhere
- What to do
- Add the schema to components.schemas or fix the name.
AMS-E08
- Level
- tip
- Check
- A body schema on GET/DELETE is not used
- What to do
- Bodies are checked only for POST, PUT and PATCH.
AMS-E09
- Level
- warning
- Check
- A 204/304 response has a body
- What to do
- Per HTTP these responses have no body — the text is ignored.
Limitations
- YAML is read by a built-in parser for the common subset: anchors (&, *), tags (!), complex keys and multiple documents are not supported — save the spec as JSON.
- External $refs (other files and URLs) are not loaded; responses are JSON only, and methods are GET, POST, PUT, PATCH and DELETE.
- Schema checks cover a JSON Schema subset: type, required, properties, additionalProperties, items, enum, const, format (email, uuid, date-time, date, uri, ipv4), bounds, lengths, pattern and allOf/anyOf/oneOf. Keywords outside it are not checked.
- The generator picks plausible but fictional values; complex regular expressions are not reproduced — such an example will not match its pattern, and the check will show it.
- mock-server.mjs is a development test server, not production: no auth, no rate limits and no data kept between restarts.
Privacy
- Specs, request and response bodies are processed in your browser; the console makes no network calls and the page address does not change.
- The project and versions are stored only in this browser (localStorage); the request log lives only in the tab’s memory. “Clear all” deletes the data.
- Analytics receives only the fact of a request, check or export and a category (status class, file format) — no paths, bodies or schemas.
- The result reaches us only if you send a request yourself and keep the “Attach the result” box ticked — the form shows exactly what will be sent: the number of endpoints, a “method · path · statuses” list and contract violations. Response bodies, schemas and headers are never included.
Related tools
All tools · 40
Release readinessAn evidence-backed check matrix: CI, migrations, backups, a rollback plan, monitoring, risk exceptions and sign-off → a GO / NO-GO decision.
Screenshot → Bug reportA screenshot or video → private data hidden, the problem marked up, reproduction steps, a human check and export to GitHub, GitLab or Jira.
User flow testerA user-flow builder → ready Playwright tests guarded against running on production, coverage of key routes and a pass/fail results view.
UI consistency checkerDesign tokens vs CSS: off-system colours and sizes, WCAG contrast, screenshot comparison against an approved baseline, and triage.
MVP validation toolkitHypotheses with thresholds, a landing page and lead form, UTM links, a funnel, interviews and an experiment report → continue, pivot or stop.
Proposal builderProposal templates for IT projects: scope, phases, estimate, timeline, assumptions and exclusions, versions with number control, approval and PDF.Need a backend that matches the contract?
We design the API, agree the contract with the frontend and build the server side with tests. Scope and cost come after a brief.
- The first short conversation is free — we choose the format
- NDA — yours or ours
- Pricing after a brief and an agreed scope