---
title: Mocks
description: This page is an introduction to mock servers in Insomnia.
url: "/insomnia/mock-servers/"
canonical_url: "/insomnia/mock-servers/"
content_type: landing_page
products:
- Insomnia
canonical: true


---






# Mocks



A mock server (or a mock) is a tool used to simulate API endpoints. Mocks can be particularly useful while [designing an API](/insomnia/design/). They can be self-hosted or hosted on the cloud.





## Cloud-hosted mocks
The Insomnia Cloud mock servers allow you to create a mock endpoint in a few steps. You simply need to provide an endpoint and a sample response. You get a number of free mock requests based on your plan. For more details, see the [pricing page](https://insomnia.rest/pricing).
 
[Learn more about cloud-hosted mock servers &rarr;](/how-to/create-a-cloud-hosted-mock-server/)




## Self-hosted mocks
Users can deploy self-hosted mock servers using [Insomnia Mockbin](https://github.com/kong/insomnia-mockbin). This allows you to have more control over usage for your mocks.

[Learn more about self-hosted mock servers &rarr;](/insomnia/self-hosted-mocks/)




## Auto-generated mocks
Auto-generate a mock server from a natural language prompt and one of the following input types: URL, OpenAPI, or JSON. This feature is optional and can be deactivated.
 
[Learn more about auto-generated mock servers &rarr;](/insomnia/self-hosted-mocks#create-an-auto-generated-mock-server)   





## Security warnings
When using mock servers, keep the following security considerations in mind:
  * Always be sure you trust the author of a mock server before calling it, visiting it, or adding it to your code. 
  * Like any URL, mock servers can contain malicious content or redirects.
  * To enable easy use from anywhere, especially for front-end feature development, Insomnia's mock servers have a very permissive CORS configuration (`Access-Control-Allow-Origin: *`, `Access-Control-Allow-Credentials: true`). 
  A malicious API could be used to exfiltrate data.





## Dynamic mocking
Dynamic mocking expands Insomnia’s mock servers with the Liquid template language that generates context-aware and realistic responses.
Each response is rendered server-side by the mock server using Liquid templates with a safe, restricted tag set.
Insomnia also provides faker variables for generating random names, dates, and other test data at runtime.

Dynamic mocking is supported in both cloud-hosted and self-hosted mock servers, and powered by the Insomnia **Mockbin** service.
[Learn more about Dynamic mocking](/insomnia/dynamic-mocking/)




## Frequently asked questions


- Are mock servers available for all users?
  Yes mocks are available both self-hosted or hosted on the Insomnia cloud on all our plans.

- Can I automatically generate mock endpoints?
  Yes, you can generate a mock endpoint from a request response. 
  After sending a request, go to the **Mock** tab in the right panel and select or create a new mock server and route.
  The generated endpoint will contain the response body, headers, and status.

- Are Mock request available on local Scratch Pad?
  No. Mock servers are not available in the local **Scratch Pad**. To use mock servers, sign up for an Insomnia account.


