# Randomised Responses

The behavior of production APIs in real-world scenarios is all but reliable. Due to various constraints (like network congestion, bad request from client side or even sometimes server failures), your back-end APIs might behave in different ways, producing different responses.

In the **Dynamic Responses** section, we learned that you can add the possible outcome of an API to the Mocklets dashboard. But what if you want your API to return one of the responses randomly instead of the currently active response?

Generating random responses from the API on every request gives a true sense of working with a real-world API.

### How to make an API to return random responses

![](/files/-Lroq57BM-wKMdOaAl5n)

It's very simple to set your API to return random responses on every request. Just enable **Randomised Responses** settings of your API, and your API will starting one the response set in your api on a random basis. If enabled, this setting will override the active response.

{% hint style="info" %}
**Please note** If you have enabled the **Use Api as Proxy**, this feature will be overridden and you will receive the response sent by your proxy server.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mocklets.com/managing-mock-apis/randomized-responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
