> For the complete documentation index, see [llms.txt](https://docs.magicapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.magicapi.com/overview/custom-usage.md).

# Custom Usage

MagicAPI allows you to set custom Usage reported by your backend. These changes need to be made in your API backend. Hence when MagicAPI calls your API backend, then that backend must add this header to the response.

Please make sure you mention this clearly in your Product description on MagicAPI. You must also include this in your docs.

### Default Behavior:

By default, each request consumes "1" API call for the given Pricing Plan.\
Hence the default header is added to all requests:

```
X-Magicapi-Billing: API=1;
```

### Allow "unlimited" calls for certain endpoints

If you wish to make certain endpoints "FREE". i.e. To NOT reduce the API usage when a user requests those endpointPaths. Then you can simply pass this header:

```
X-Magicapi-Billing: API=0;
```

This will not "increase" the total APICalls used in the given plan.

### Charge more than "1" API unit for a request

Similarly to charge more than "one" unit per request, you can update this header to the custom usage and send it as a response in your API.

```
X-Magicapi-Billing: API=3;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.magicapi.com/overview/custom-usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
