POST /v1/agents/init.
Agent Init Overview
Start with the deployment flow, versioning rationale, and registration strategy.
TypeScript SDK Setup
@whyops/sdk wraps agent init and auto-registers on first trace event unless you call initAgent() explicitly.Field requirements
Response shape
Direct analyse endpoint
If you are not using the proxy, callPOST /api/entities/init on the analyse service. It accepts the same payload and returns the same response shape.
Auto-init fallback
If you skip explicit registration and start sending events first,whyops-analyse attempts best-effort auto-initialization during trace creation.
- It extracts
systemPromptfrom event metadata when possible. - It infers tool definitions from event metadata when available.
- Otherwise it creates a placeholder description.
Minimal TypeScript example
Related entity APIs
GET /api/entitieslists agents with usage and latest version.GET /api/entities/:idreturns one agent with versions and timelines.GET /api/entities/:id/version-idslists version IDs for an agent.GET /api/entities/versions/:versionIdfetches one exact version.PATCH /api/entities/:id/sampling-rateupdates version sampling rate.DELETE /api/entities/:idhard-deletes an agent and linked runtime data.
Lifecycle reminder
The integration lifecycle is:register -> send traffic -> inspect traces -> tune settings -> evaluate.