egisai client — one import, zero wiring. From any other language, call
the API directly (or point any OpenAI-compatible client at the Gateway).
Prerequisites
An EgisAI account on a plan with the Gateway enabled.
An Egis API key (Dashboard → API Keys → Create key). Keys begin with
egis_live_.A provider API key — OpenAI in the snippets below; Anthropic (
claude-… models) and Google (gemini-… models) work the same way, since the Gateway routes by model name.1. Connect
Your provider key stays exactly where it always was — in theAuthorization header — and is forwarded to the provider untouched.
Your Egis key rides in X-Egis-Api-Key (egisai.Client sets both for
you).
Connect without custom headers (BYOK vault)
Some platforms — Cursor, n8n, low-code builders — only let you set a base URL and an API key. They can’t add theX-Egis-Api-Key header. For those,
store your provider keys once and connect with only your Egis key:
1
Store your provider keys
On the dashboard’s Model Center page, open Provider keys and add
the key for each provider you use (OpenAI, Anthropic, …) — one per
provider. They’re encrypted at rest; we keep only the last four
characters for display. (Owners and admins only.)
2
Point the platform at the Gateway
Set the base URL to
https://app.egisai.co/v1/agent and the API key to
your Egis key (egis_live_…). That’s it — no headers.code: "egis_no_provider_key" telling you which provider to configure.
2. See the call on the dashboard
Open the Requests page. Your call appears within seconds, marked with a gateway channel icon. The Gateway page (under Developers) also shows a live “last call received” status — useful for confirming connectivity during setup.3. Watch a policy fire
Create a policy on the Policies page — for example, a PII scan set to sanitize on the Request phase — then send a prompt containing a fake SSN:code: "egis_policy_blocked" and HTTP 400 — the provider is never
called, and no tokens are spent.
Naming your agent
By default the Gateway derives agent identity from the system prompt, so distinct system prompts appear as distinct agents automatically. To name an agent explicitly withegisai.Client:
egisai.init() is active, the usual context API sets the header
per call — it wins over the client-level default:
set_context fields travel the same way, so the run’s
Context section fills in exactly like it does for SDK-audited traffic:
What’s next
Streaming
How
stream: true interacts with response-phase policies.Limits & behavior
Error shapes, failure modes, and current limitations.