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.
import agenko
agenko.init()instrument() is a backward-compat alias of init().
Optional arguments
All of these also have env vars. Prefer env.
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
- Resolves
AGENKO_HOST(defaulthttp://localhost:8000). - Derives OTLP ingest as
{host}/api/public/otel/v1/tracesunlessAGENKO_ENDPOINTis set. - Installs an OTEL
TracerProvider(or NodeSDK on TypeScript). - Auto-detects loaded AI frameworks and patches them.
- Creates the HTTP client for receipts and approvals.
- If an API key is present, POSTs
/api/v1/agents/connectso the console sees the agent before the first trace.
If you skip init(), @check and @approve still try to work without crashing the process.
Print line
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
- Full index: docs.agenko.app/llms.txt · sections: llms-docs.txt, llms-sdk.txt, llms-integrations.txt
- This page as markdown: docs.agenko.app/init.md
- Search API:
curl -sG "https://docs.agenko.app/api/search-docs" --data-urlencode "query=…"
Before writing SDK code
- Install the agent skill or read Agent skill
- Read Best practices — what a good receipt looks like
- Trust boundary:
@checkafter,@approvebefore init()— zero required args, never throws- Mark
estimated: trueuntil a check is a hard fact - Shipped vs backlog: Introduction status table