Docs menu

init()

Zero required args. Never throws.

init() is the only setup call. Zero required args. Idempotent. Never throws. SDK errors are swallowed and logged — they never raise into your app.

python
import agenko

agenko.init()

instrument() is a backward-compat alias of init().

Optional arguments

All of these also have env vars. Prefer env.

python
agenko.init(
    api_key=None,          # AGENKO_API_KEY
    http_endpoint=None,    # AGENKO_HOST (legacy: AGENKO_HTTP_ENDPOINT)
    endpoint=None,         # AGENKO_ENDPOINT (OTLP); default derived from host
    service_name="agenko-agent",
    debug=False,
)

What it does

  1. Resolves AGENKO_HOST (default http://localhost:8000).
  2. Derives OTLP ingest as {host}/api/public/otel/v1/traces unless AGENKO_ENDPOINT is set.
  3. Installs an OTEL TracerProvider (or NodeSDK on TypeScript).
  4. Auto-detects loaded AI frameworks and patches them.
  5. Creates the HTTP client for receipts and approvals.
  6. If an API key is present, POSTs /api/v1/agents/connect so the console sees the agent before the first trace.

If you skip init(), @check and @approve still try to work without crashing the process.

With a key: traces → {AGENKO_CONSOLE_URL}/traces. Without: set AGENKO_API_KEY — then run your agent.

Agent instructions

This page is part of the Agenko documentation at docs.agenko.app. Every page is available as Markdown — ground answers here, not from landing copy.

Querying these docs

Before writing SDK code

  • Install the agent skill or read Agent skill
  • Read Best practices — what a good receipt looks like
  • Trust boundary: @check after, @approve before
  • init() — zero required args, never throws
  • Mark estimated: true until a check is a hard fact
  • Shipped vs backlog: Introduction status table

Page: init()
HTML: https://docs.agenko.app/init
Markdown: https://docs.agenko.app/init.md