Set Up Your First Provider
This tutorial walks you through adding your first AI provider to the gateway using the admin dashboard. We will configure OpenAI, but the same steps apply to any of the 28 supported providers.
Prerequisites
- A running Gatewyse instance (server + MongoDB + Redis)
- Admin dashboard accessible (default:
http://localhost:3001) - An OpenAI API key from platform.openai.com
Step 1 — Log in to the Admin Dashboard
- Open the admin dashboard in your browser.
- Enter your admin credentials (email and password).
- After successful login you will land on the main dashboard.
Step 2 — Navigate to the Providers Page
- In the sidebar, click Providers.
- The providers list shows all configured provider connections for your tenant.
- Click the Add Provider button in the top-right corner.
Step 3 — Select the Provider Type
- In the “Add Provider” form, select OpenAI from the adapter type dropdown.
- Enter a display name, for example
OpenAI Production. - Enter a unique slug, for example
openai-prod. This slug is used in routing configurations and API responses.
Step 4 — Configure Authentication
- Set Auth Type to
api-key. - Paste your OpenAI API key into the API Key field.
- The header name and prefix default to
AuthorizationandBearerfor OpenAI. Leave these as-is unless you have a custom proxy.
Step 5 — Configure Connection Settings
- Base URL — Leave blank to use the default OpenAI endpoint (
https://api.openai.com/v1). Set a custom URL only if you use an OpenAI-compatible proxy. - Timeout — The request timeout in milliseconds. Default
30000(30 seconds) works for most use cases. - Max Retries — Number of automatic retries on transient failures (connection errors, 429, 5xx). Default
2is recommended. - Initial Retry Delay — Base delay in milliseconds before the first retry. The gateway uses exponential backoff, doubling this value on each attempt up to a 30-second cap.
- Max Concurrency — Maximum parallel requests to this provider. Adjust based on your OpenAI rate limits.
Step 6 — Select Models
- After saving the provider, navigate to the Models section for this provider.
- Click Add Model and enter the model ID, for example
gpt-4o. - Set the model capabilities:
chat,streaming,function-calling,vision. - Optionally configure pricing (input/output cost per million tokens) for cost-based routing.
- Repeat for additional models such as
gpt-4o-miniorgpt-3.5-turbo.
Step 7 — Test Connectivity
- Return to the provider detail page.
- Click the Health Check button. The gateway calls the provider’s models endpoint to verify the API key and network connectivity.
- A successful health check updates the provider status to Healthy with the measured latency.
- If the check fails, verify your API key, network access, and base URL.
Step 8 — Verify in the Dashboard
- Navigate back to the Providers list.
- Your new provider should appear with a green health indicator.
- The health status includes average latency, last check time, and consecutive failure count.
What Happens Under the Hood
When you add a provider, the gateway creates a ProviderConfig document in MongoDB that stores:
- Adapter type (e.g.,
openai) — determines which adapter class translates requests - Authentication credentials (encrypted at rest)
- Connection parameters (timeout, retries, concurrency)
- Health status (updated by periodic health checks)
The BaseProviderAdapter class provides shared functionality (HTTP requests, SSE parsing, SSRF validation), while the OpenAIAdapter handles OpenAI-specific request/response translation.
Next Steps
- Create Routing Rules to direct traffic to your provider
- Add a second provider for failover redundancy
- Configure Guards to protect your API traffic