Connect your app to e-Gate AI Gateway in minutes — just swap the base URL and API key.
e-Gate AI Gateway is an OpenAI-compatible API. Call every model through a single base URL. API keys embed the serving server (machineId) — the gateway routes requests to the right server automatically:
sk-61d35a1d80f1d3dd-... — Server 1sk-9357e1fe59b66398-... — Server 2Create a key in the dashboard and the gateway handles the rest — no extra configuration needed.
Sign in to the dashboard → API Keys → pick a server, name the key, set a budget → Create. The full key (sk-<machineId>-...) is shown only once — copy and store it immediately.
Every request must include an Authorization header with a Bearer token using your key:
Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEYAll requests go to a single endpoint. Drop the per-provider base URLs you used before.
https://agent.e-gate.vn/v1Replace YOUR-KEY with your key. Valid models include: gpt-4o, claude-3-5-sonnet, gemini-2.0-flash, deepseek-chat — see the full list on the Prices page.
curl https://agent.e-gate.vn/v1/chat/completions \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{ "role": "user", "content": "Hello!" }]
}'e-Gate is fully compatible with the official OpenAI SDKs — just point base_url to e-Gate and swap the api_key:
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepseek.com" # ← use https://agent.e-gate.vn/v1,
api_key="sk-61d35a1d80f1d3dd-YOUR-KEY",
)
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)Streaming (SSE):
stream = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://agent.e-gate.vn/v1',
apiKey: 'sk-61d35a1d80f1d3dd-YOUR-KEY',
});
const resp = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(resp.choices[0].message.content);Configure popular tools with your base URL and API key.
# Cursor → Settings → Models → Add custom model
Name: gateway
Base URL: https://agent.e-gate.vn/v1
API Key: sk-61d35a1d80f1d3dd-YOUR-KEY
Model ID: gpt-4o (or any model from /v1/models)When the server has media providers configured, call these OpenAI-compatible endpoints:
# Image generation
curl https://agent.e-gate.vn/v1/images/generations \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"dall-e-3","prompt":"a cat","n":1,"size":"1024x1024"}'
# Video generation (when provider available, e.g. veo/kling/seedance)
curl https://agent.e-gate.vn/v1/videos/generations \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"veo-3","prompt":"a running dog"}'Error codes you may encounter:
Need help? Contact the e-Gate Center fanpage or email [email protected].