Use this page when you need the exact registration payload and follow-up API behavior behindDocumentation Index
Fetch the complete documentation index at: https://whyops.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
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
| Field | Type | Required | Notes |
|---|---|---|---|
agentName | string | Yes | 1-255 chars; must match the X-Agent-Name header you use later |
metadata.systemPrompt | string | Yes | Required for version hashing and UI display |
metadata.tools | array | Yes | Can be empty, but must be present |
metadata.tools[].name | string | Yes | Tool identifier |
metadata.tools[].inputSchema | string | Yes | JSON schema string, not an object |
metadata.tools[].outputSchema | string | Yes | JSON schema string, not an object |
metadata.tools[].description | string | Yes | Human-readable purpose |
metadata.description | string | No | Optional agent description |
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.