Documentation Index
Fetch the complete documentation index at: https://docs.egisai.co/llms.txt
Use this file to discover all available pages before exploring further.
- Supported provider SDKs (
openai,anthropic,google-generativeai) are patched in place. - Optionally,
httpxandrequestsare wrapped for HTTP-level audit visibility. - Background workers are started for live updates and audit delivery.
egisai.shutdown()is registered withatexitto flush events on exit.
init() is idempotent. Calling it twice in the same process is a no-op
after the first call.
Parameters
Your platform API key (the one starting with
egis_live_ that you created on
the dashboard’s API Keys page).If not provided, falls back to the EGISAI_API_KEY environment variable.Required — init() raises RuntimeError if neither source provides a key.Logical agent name. The platform auto-creates an Agent matching this name in
your org if one doesn’t exist; subsequent calls from this SDK instance are
attributed to it for auditing.Set this to a stable, machine-friendly identifier (e.g.
"customer-support-bot") so it reads well on the dashboard.Free-form environment label (
"dev", "staging", "prod", …). Used for
segmentation on the dashboard. Has no effect on policy evaluation itself.Override the platform URL. Defaults to
EGISAI_BASE_URL if set, otherwise
the hosted control plane.Only set this if directed to do so by EgisAI (for example for a regional
deployment or an enterprise install).How blocked calls are surfaced to your code:
"raise"— raisePermissionError."stub"— return a framework-shaped refusal object so the application keeps running.
How often to poll for policy changes if the live update channel is
unavailable. Lower values mean faster picks-up of dashboard changes at the
cost of more polling traffic.
Subscribe to live policy and configuration updates when supported. Falls
back to polling on connection failure. Disable if your environment blocks
long-lived HTTP connections.
Patch
httpx and requests for HTTP-level audit visibility. Useful when
your application calls model endpoints directly rather than through one of
the official provider SDKs. See HTTP clients.Suppress the one-line
✓ [egisai] active … startup banner on stderr.Returns
None. Side effects (patching, background workers) happen in place.
Raises
RuntimeError— when neitherapi_key=norEGISAI_API_KEYprovides a key.ValueError— whenon_blockis not"raise"or"stub".
Example
Idempotence
egisai.shutdown() first.
What’s next
set_context
Attach per-call metadata after init.
Configuration guide
Walks each option in plain English.