Skip to main content

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

  1. Log in or sign up on the Gateway dashboard
  2. Create your first project and give it a name

Dashboard with project creation form

Step 2: Add a Service

In Gateway, we refer to APIs as "Services". To add a new service:

  1. Navigate to the Services tab in the sidebar
  2. Click "Add new service"
  3. Provide the base domain you want to proxy (e.g., api.openai.com) or choose from the list of pre-configured services

Service configuration form

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

  1. Navigate to the "API keys" tab from the service page
  2. Enter a name and your Service Provider API key
  3. Click "Create key"
  4. Copy the key to your clipboard and save it in a secure location (it will not be shown again)

API key generation form

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:

  1. Go to the "Rate Limiting" section in your project settings
  2. Click "Add New Rule"
  3. Configure the following parameters:
    • Number of maximum requests
    • Time window
  4. Save the rule

Rate limiting configuration form

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

  1. With your Service endpoint and API key in hand, go to your app's codebase
  2. Find the file where you make configure/make your API calls
  3. Replace the original Service API endpoint with the Gateway endpoint
  4. Replace the original Service API key with the Gateway API key

Code Samples

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:

  1. Open the Live Charts in the Gateway dashboard
  2. Make a test request
  3. View the responses in the console

Request Charts

If you encounter any issues, please refer to our troubleshooting documentation or contact support for assistance.