Skip to main content

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.

The SDK is configured at three layers. From highest to lowest precedence:
  1. Keyword arguments to egisai.init(...).
  2. Environment variables read by egisai.init().
  3. Defaults built into the package.
Most applications only need to set EGISAI_API_KEY and pass app= / env= to init(). Everything else has a sensible default.

Initialization parameters

egisai.init(
    *,
    api_key=None,
    app="default",
    env="production",
    base_url=None,
    on_block="raise",
    refresh_interval_seconds=10.0,
    enable_sse=True,
    enable_http_fallback=True,
    quiet=False,
)
ParameterDefaultWhat it does
api_keyRequired. Your SDK API key (egis_live_…). Falls back to EGISAI_API_KEY.
app"default"Logical agent name — appears as an Agent on the dashboard.
env"production"Environment label for segmentation ("dev", "staging", "prod", …).
base_urlHosted control planeOverride only when directed by EgisAI. Falls back to EGISAI_BASE_URL.
on_block"raise""raise" to raise PermissionError, "stub" to return a refusal-shaped response.
refresh_interval_seconds10.0Polling interval for policy updates when the live channel is unavailable.
enable_sseTrueSubscribe to live policy updates.
enable_http_fallbackTruePatch httpx / requests for HTTP-level audit visibility.
quietFalseSuppress the one-line startup banner on stderr.
Every parameter has a corresponding section in the init reference.

Environment variables

VariablePurpose
EGISAI_API_KEYSDK API key if not passed as api_key=.
EGISAI_BASE_URLOverride the control plane URL. Use only if directed to do so.
Keep your API key out of source control. Use environment variables, a secrets manager, or your platform’s configuration store.

Local development

export EGISAI_API_KEY="egis_live_…"
import egisai
egisai.init(app="dev-bot", env="dev")

Production with stub mode

import egisai
egisai.init(
    app="customer-support-bot",
    env="production",
    on_block="stub",
    quiet=True,
)

Strict / restricted networks

If your environment blocks long-lived HTTP connections, disable the live update channel and rely on polling:
egisai.init(
    app="bot",
    env="production",
    enable_sse=False,
    refresh_interval_seconds=30.0,
)

Custom HTTP clients only

If your application doesn’t use any official provider SDK and instead calls endpoints directly via httpx or requests:
egisai.init(
    app="custom-llm-bot",
    env="production",
    enable_http_fallback=True,    # default; shown for clarity
)
If you don’t need HTTP fallback (because you only use official SDKs), turn it off to skip patching:
egisai.init(
    app="bot",
    env="production",
    enable_http_fallback=False,
)

Verifying configuration at startup

The startup banner echoes the resolved configuration:
✓ [egisai] active — app=customer-support-bot env=production on_block=raise integrations=[openai, anthropic] policies=12
If you don’t see this line, either init() was never called, or you passed quiet=True. Set quiet=False and re-run to confirm the SDK is active.

What’s next

Blocking behavior

Choose between raise and stub modes.

Multi-agent context

Distinguish several agents in one process.