Integration Guide
Overview
This guide will walk you through the process of integrating Gateway into your application. You can follow the steps below to get started.
Step 1: Create a New Project
- Log in or sign up on the Gateway dashboard
- Create your first project and give it a name
Step 2: Add a Service
In Gateway, we refer to APIs as "Services". To add a new service:
- Navigate to the Services tab in the sidebar
- Click "Add new service"
- Provide the base domain you want to proxy (e.g., api.openai.com) or choose from the list of pre-configured services
Note: Ensure your service account is up to date. If you've exceeded your usage limit, you'll see a 429 error in the Gateway Live Console.
Step 3: Generate a New Key
- Navigate to the "API keys" tab from the service page
- Enter a name and your Service Provider API key
- Click "Create key"
- Copy the key to your clipboard and save it in a secure location (it will not be shown again)
Important: Use a fresh, uncompromised key. Do not use keys that have previously been exposed in production versions of your app.
Step 4: Configure IP Rate Limiting
To protect your API from abuse, it's recommended to set up IP rate limiting rules:
- Go to the "Rate Limiting" section in your project settings
- Click "Add New Rule"
- Configure the following parameters:
- Number of maximum requests
- Time window
- Save the rule
Tip: Start with conservative limits and adjust based on your application's needs. You can always modify these rules later.
Step 5: Add Gateway to Your App
- With your Service endpoint and API key in hand, go to your app's codebase
- Find the file where you make configure/make your API calls
- Replace the original Service API endpoint with the Gateway endpoint
- Replace the original Service API key with the Gateway API key
Step 6: Test Your Integration
With the above steps completed, you're ready to test your API calls through Gateway. The best way to verify your integration is:
- Open the Live Charts in the Gateway dashboard
- Make a test request
- View the responses in the console
If you encounter any issues, please refer to our troubleshooting documentation or contact support for assistance.