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://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)Images are synchronous; videos are async (create job → poll status → download file). Videos bill per second — see the $/sec rates on Prices.
# 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 (async: create → poll → download)
curl https://agent.e-gate.vn/v1/videos/generations \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"videopr/wan3.0","prompt":"a cat walking","seconds":"5","size":"1280x720"}'
# → {"id":"task_...","status":"queued"} — poll until completed.
# Use the id exactly as returned (it may look like "task_x:provider").
# If the server says "Query parameter 'model' is required", add ?model=<model>:
curl https://agent.e-gate.vn/v1/videos/task_... \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY"
# → {"status":"completed","video_url":"https://...mp4"} — download the fileReturns binary audio (not JSON) — save to a file with the matching extension. Input max 4096 characters.
# Text-to-speech (returns binary audio, not JSON)
curl https://agent.e-gate.vn/v1/audio/speech \
-H "Authorization: Bearer sk-61d35a1d80f1d3dd-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello world","voice":"alloy","response_format":"mp3"}' \
--output hello.mp3Error codes you may encounter:
Need help? Message us on Messenger (Messenger), Telegram (t.me/egateai) or email [email protected].