Mock APIs you can call before the backend exists.
Hosted REST and GraphQL mocks with realistic data, stateful CRUD, latency, rate limits and failure scenarios. Import an OpenAPI spec, or let your AI agent build the mock over MCP.
The Free plan includes 3 projects and 500 requests a month per project.
MCP server https://mcp.mockapi.com/api/mcp Connect Cursor, Claude or ChatGPT
The first GET /users seeds 25 users. Writes persist in this tab.
| Rev | Request | Status | Change |
|---|---|---|---|
| A | GET /users | not sent | Seeds 25 users on the first read |
- Note 1 Click the screen or press Send GET /users. Move across the table to cut a section.
- Note 2 Keyboard: Tab to the table, arrows move the cut, Enter sends and then pins a row, Esc clears.
- Note 3 Demo project: stateful mode on (Developer plan and above), rate limit 60 per minute, latency Random 38-140 ms. Nothing leaves this tab.
| Sheet | 01 / 03 |
|---|---|
| Drawing | Team screen · GET /users |
| Status | Runs in this tab |
| Requests | 0 |
| Rev | None |
| Last | GET /users · not sent |
How this runs
This screen is served by a copy of the api.mockapi.com runtime rules running in your browser. Nothing is sent to a server.
The project has stateful mode on, which needs the Developer plan or above: the first read seeds 25 records, and writes persist. On the Free plan every GET returns freshly generated data.
The rows are a fixed sample of real generator output, so every visitor starts from the same page; hosted projects generate new values each time a store is seeded.
Every figure on this page runs the rules your mock runs.
Project spec
- Stateful
- on · 25 records seeded on first read · Developer plan and above Fig 0.1
- Rate limit
- 60 per minute · fixed clock-minute window Simulation docs
- Latency
- Random 38-140 ms · 4 modes up to 10 s Simulation docs
- Scenarios
- 6 examples, chosen per request with
X-MockAPI-ScenarioSimulation docs - Locale
en· 62 locales available Data generation docs- Data types
- 140+ types · linked models Model builder demo
- Imports
- OpenAPI 3 · Swagger 2 · Postman · JSON sample · GraphQL SDL Fig 1.1
- Hosts
api.mockapi.com·graphql.mockapi.com·mcp.mockapi.comDocs- Also
- Contract drift · request logs · teams (Developer and above) Docs
- Price
- Free plan · Developer $4.99 per month Pricing
Works with any client that speaks HTTP
- React
- Next.js
- Vue
- Angular
- Svelte
- React Native
- Flutter
- Swift
- Kotlin
- Cypress
- Playwright
- Jest
- Postman
- Cursor
- Claude Code
- Storybook
Bring your own API
Drop an OpenAPI 3, Swagger 2 or Postman file, or a JSON sample. It is parsed in this tab and never uploaded. Call the endpoints before you create an account.
Operations
Models
Orderid→ id (name rule, sequential)customerEmail→ email (name rule)items→ Book[] (linked model)quantity→ number (integer)shippingAddress→ address (name rule)createdAt→ date (name rule)
Authorid→ id (name rule, sequential)name→ fullName (name rule)email→ email (name rule)country→ country (name rule)website→ url (name rule)books→ Book[] (linked model)
Bookid→ id (name rule, sequential)isbn→ string (fallback)title→ sentence (name rule)author→ object (object)price→ price (name rule)publishedOn→ date (format date)inStock→ boolean (boolean)
- Note 1 Drop a file anywhere on this page.
- Note 2 Click an endpoint to call it.
- Note 3 Move across the response to see which import rule chose each type.
| Sheet | 02 / 03 |
|---|---|
| Drawing | bookshop.yaml |
| Status | Runs in this tab |
| Requests | 0 |
| Rev | A |
| File | openapi 3.0.3 · 3 models · 8 operations · sample, committed fixture |
| Coverage | 8 of 8 operations have a response model |
| Plan fit | Fits the Free plan: 5 endpoints, 3 models |
How this runs
Parsed in this tab with the dashboard import's own parser and type rules. Nothing is uploaded.
On the Developer plan and above, the import can also suggest AI type changes for you to review; the drawing shows the types before that review.
An operation without a response model, such as one whose response schema is inline, is imported without one and returns {"data":{}} until you attach a model.
A reference to a model the import creates later cannot be linked, so the type rules type it: in the sample, Book.author is {}.
Values are a fixed sample of real generator output per type; a new project generates new ones on every request. Emails show at example.com; the email type uses common mail domains.
The endpoints answer as a new Free project does: generated data, no rate limit, no simulated latency.
For AI agents
Give your AI agents a safe API sandbox
Connect Cursor, Claude Code, Claude Desktop or ChatGPT over the Model Context Protocol. Agents create projects, models and endpoints from a prompt, import OpenAPI specs and Postman collections, and turn on stateful mode, all against an isolated mock instead of production.
- Create projects, models and REST or GraphQL endpoints from a prompt
- Import OpenAPI specs and Postman collections automatically
- Seed stored records for every model with stateful mode (Developer plan and above)
- No risk to production data. Every call goes to an isolated mock
Cursor · Claude · ChatGPT
{
"mcpServers": {
"mockapi": {
"url": "https://mcp.mockapi.com/api/mcp",
"headers": {
"Authorization": "Bearer mockapi_mcp_…"
}
}
}
}Prompt
Create a mock API for a todo app with users and tasks. Tasks belong to a user and have a due date.
Agent
- create_project → todo-app
- create_model → User, Task (task.userId → User)
- create_rest_endpoint → 8 endpoints
- Live at https://api.mockapi.com/tasks
Use cases
One mock layer for every team that builds on your API
Build the UI before the backend exists
Agree on the contract, mock it in minutes and build screens in parallel. When the real API ships, change the base URL and nothing else.
- Realistic data shows layout problems early: long names, empty states, edge cases
- Stateful CRUD means forms, lists and detail pages actually work
- CORS is on by default, so you can call it from localhost
Test the paths production rarely shows you
Rate limits, timeouts, 401s, 503s and empty states on demand, repeatable in CI.
- Named scenarios switchable per request with a header
- Latency profiles to catch race conditions and missing spinners
- Stable URLs for Cypress, Playwright, Jest and Postman runs
Unblock iOS, Android and Flutter teams
You don't need a local server or a tunnel. A hosted HTTPS endpoint works on simulators and real devices.
- Test offline handling with slow-network and error scenarios
- Image URLs and realistic media for real-looking screens
- Share one mock across web and mobile clients
Let agents build and test against a sandbox
Coding agents need an API they can call and change without touching production. MockAPI gives them one, and lets them manage it themselves over MCP.
- MCP tools for projects, models, endpoints and imports
- Scenarios return the exact status and body you saved, on every call
- Isolated from production by design
Demo environments that never break
Pre-seeded, persistent data for product tours, workshops and sales demos, without touching a real customer record.
- Custom domains for a branded demo URL
- Persistent state so the story survives the meeting
- Reset to a clean slate in one click
Compare
Why teams move to MockAPI
Local mock scripts and recorded stubs break the moment your API changes. MockAPI is hosted, shared by your whole team and generated from your API contract.
| MockAPI | json-server / local scripts | Postman mock servers | WireMock / Prism (self-hosted) | |
|---|---|---|---|---|
| Hosted URL your whole team shares | ||||
| Generate from OpenAPI / Postman | ||||
| Realistic generated data | ||||
| Stateful CRUD | ||||
| Scenarios, latency & rate limits | ||||
| GraphQL mocking | ||||
| MCP server for AI agents | ||||
| No infrastructure to maintain |
Pricing
Start free and upgrade when you need more
Every plan includes REST and GraphQL mocking, realistic data and scenarios. Paid plans add higher limits, stateful CRUD and team features.
Free
For trying things out and side projects
Free forever
Start free- 500 requests/mo per project
- 3 projects
- 25 endpoints / project
- 1 team member
- 3-day request logs
- REST & GraphQL mocking
- Scenarios, latency & rate limits
- OpenAPI & Postman import
- Stateless responses
- Community support
Developer
For individual developers shipping real apps
$47.88 billed annually
Start with DeveloperEverything in Free, plus:
- 50,000 requests/mo per project
- 25 projects
- 100 endpoints / project
- 5 team members
- 7-day request logs
- Stateful CRUD · 100 records/model
- AI-assisted data generation
- Email support
Team
For product teams building together
$191.88 billed annually
Start with TeamEverything in Developer, plus:
- 200,000 requests/mo per project
- 100 projects
- 500 endpoints / project
- 25 team members
- 30-day request logs
- Stateful CRUD · 1,000 records/model
- Custom domains
- Roles & permissions
Business
For organizations running mocks at scale
$479.88 billed annually
Start with BusinessEverything in Team, plus:
- 1,000,000 requests/mo per project
- 500 projects
- Unlimited endpoints & models
- Unlimited team members
- 90-day request logs
- Stateful CRUD · 5,000 records/model
- Management API for CI/CD
- Priority support
Enterprise
SSO/SAML, audit logs, custom SLAs, dedicated support and private deployment options.
Cancel anytime. Prices in USD.
FAQ
Questions, answered
What is MockAPI?
MockAPI is a hosted platform for creating mock REST and GraphQL APIs. You define or import your API, and MockAPI serves realistic, generated responses at a stable URL, with optional stateful CRUD, latency, rate limiting and failure scenarios. Frontend, mobile, QA and AI agents can build against it before the real backend exists.
Is MockAPI free?
Yes. The Free plan is free forever and needs no credit card. It includes 500 mock requests per month per project, 3 projects and 25 endpoints per project, with REST, GraphQL, realistic data and scenarios. Paid plans start at $4.99/month and add stateful CRUD, higher limits and team features.
Can I import my OpenAPI (Swagger) spec or Postman collection?
Yes. Import OpenAPI 3.x, Swagger 2.0 or a Postman collection and MockAPI creates the models and endpoints for you. You can also import a JSON sample, and re-check your mocks against a newer spec later with contract drift detection.
What is stateful mode?
In stateful mode your mock keeps data across requests: POST creates a record, GET returns it, PATCH and PUT update it and DELETE removes it, with pagination, filtering and sorting. It's available on the Developer plan and above.
Does MockAPI support CORS?
Yes. CORS is enabled on every mock endpoint by default, so you can call your mock directly from a browser app running on localhost or any domain.
How do I simulate errors, latency and rate limits?
Create named scenarios (for example payment-declined or rate-limited) and select one per request with the X-MockAPI-Scenario header, or set a default. Projects can also add latency profiles and per-minute rate limits that return real 429 responses and X-RateLimit headers.
Can AI agents like Cursor and Claude use MockAPI?
Yes. MockAPI ships a Model Context Protocol (MCP) server. Connect it to Cursor, Claude Code, Claude Desktop or any MCP client by signing in or with an API key, and agents can create projects, models and endpoints, import specs and turn on stateful mode.
Can I use MockAPI in CI/CD?
Yes. Mock URLs are stable and authenticated with an API key, so they work in Cypress, Playwright, Jest, Postman/Newman or any test runner. The Business plan adds a Management API to manage mocks programmatically.
Is the demo on this page a real mock?
Every figure on this page runs the rules your mock runs. A small copy of the MockAPI runtime rules runs in your browser, with the same status codes, error bodies, pagination, latency modes and rate limit headers as api.mockapi.com. The requests you send from the figures are answered in your browser and never reach a server. Your own projects run on api.mockapi.com and graphql.mockapi.com.
This is the response you built
The last request you send from Fig 0.1 appears here, with its response, curl and fetch.
Nothing sent yet. Send a request from Fig 0.1 and its response appears here.
| Figure | Request | Status | Time | Copy |
|---|---|---|---|---|
No requests yet. Send one from Fig 0.1. | ||||
- Note 1 Each row is a request sent from Fig 0.1.
- Note 2 Copy any row as curl.
| Sheet | 03 / 03 |
|---|---|
| Drawing | GET /users |
| Status | Runs in this tab |
| Requests | 0 |
| Rev | None |
How this runs
Requests sent from the figures on this page run through one copy of the api.mockapi.com runtime rules in your browser. They are answered there and never reach a server.
A request the project's rate limit refused counts as rate limited. An error response from a scenario picked with X-MockAPI-Scenario counts as failed on purpose.
In place of a key, curl prints $MOCKAPI_KEY and fetch prints MOCKAPI_KEY. Set that variable to your own project's key and give the project an endpoint for the path, and the request runs against api.mockapi.com.
Record ids in PATCH and DELETE paths come from this tab's store, not from your project. With stateful mode on (Developer plan and above), use one of its own record ids. Without it, an endpoint with {id} in its path answers any id.
A click saves this project in this browser if it allows storage. Your dashboard then offers to create its User model, /users endpoints, scenarios, rate limit and latency. Replace $MOCKAPI_KEY with its key.
On the Free plan, GET returns fresh data each time; stored writes need the Developer plan or above.
The Free plan includes 3 projects and 500 requests a month per project.