Call Third Party APIs
MaskAPI makes it easy to call and manage third-party APIs from your custom endpoints. Whether you’re integrating with services like Stripe, OpenAI, or Airtable, MaskAPI lets you act as a proxy layer with full control over headers, data, timeouts, and logic.
🦹♂️ What is Mask Mode?
In MaskAPI Studio, Mask Mode lets your endpoint acts as a gateway between your frontend and an external API. This gives you:
-
A secure way to hide API keys and tokens from the frontend
-
Pre- or post-process external responses
-
Custom request/response formatting
-
Built-in debugging, timeouts, and status code handling
🌍 How to Set a Global Base URL
If you'd like to avoid repeating the same base URL (like https://api.openai.com) in every endpoint, follow these steps:
-
Select your project
-
Go to the "Settings" tab
-
Under "Project Global Configurations" section
-
Add your the URL in "Base URL" field
-
Click "Save Changes" on the top of the page
All your endpoints in the project can use {{project-baseUrl}}
as a placeholder in the URL field.
⚙️ How to Create a Mask Endpoint
If you a specific single endpoint to overwrite the Global Base URL, follow these steps:
-
Select your project
-
Go to the "Studio" tab
-
Create a new endpoint
-
Switch to "Mask" mode
-
Set method (e.g.
GET
,POST
) -
Set URL
{{project-baseUrl}}/v1/completions
(for example)
MaskAPI will replace {{project-baseUrl}}
with the base URL from your project settings at runtime.
⚙️ How to Overwrite the Global Base URL
If you a specific single endpoint to overwrite the Global Base URL, follow these steps:
-
Select your endpoint
-
Replace
{{project-baseUrl}}/v1/completions
withhttps://api.openai.com/v1/completions
(for example) -
Test and save
🧪 How to Test Your Endpoint
In order to test your API:
- Use the Playground inside the Studio to send live test requests
- Use
console.log()
inside your endpoint to inspect values - View logs and debug output directly in MaskAPI Studio