MagicAPI
MagicAPI
  • 👋Welcome to MagicAPI
  • Overview
    • Creating an API Store
    • Importing an API Source
    • Creating a Product using the Wizard
    • User Portal
    • Testing Your APIs & Products
    • Analytics & Logs
    • Configure Custom DNS for your API Store
    • Custom Usage
  • Concepts
    • Understanding Products
    • API Keys
  • Fundamentals
    • Convert Postman Collection to OpenAPI Yaml
    • Create OpenAPI spec using ChatGPT
  • API Providers
    • Toon Me API
    • Advanced Toon Me API
  • About Us
Powered by GitBook
On this page
  • Default Behavior:
  • Allow "unlimited" calls for certain endpoints
  • Charge more than "1" API unit for a request

Was this helpful?

  1. Overview

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;

PreviousConfigure Custom DNS for your API StoreNextUnderstanding Products

Last updated 1 year ago

Was this helpful?