Docs / Quickstart

SDK Quickstart

Send your first agent event to ClawTrait in under 60 seconds. No SDK package required — just fetch.

1

Get your API key

Sign up (or sign in) and grab your API key from the dashboard. Keys start with ct_.

Get your API key →

2

Pick your language

ClawTrait works with any language that can make HTTP requests. No special SDK needed — use the built-in fetch or install a lightweight HTTP client:

npm install node-fetch # or use built-in fetch
3

Send your first event

Three lines of code. That is it.

// 3 lines to send your first event const response = await fetch('https://clawtrait.com/api/ingest', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Agent-Key': 'YOUR_API_KEY', }, body: JSON.stringify({ task_type: 'email_reply', model: 'claude-3.5-sonnet', tokens_used: 1500, status: 'success', duration_ms: 2400, }), })

Replace YOUR_API_KEY with your real key. The event appears in your dashboard within seconds.

4

See it in the dashboard

Open your ClawTrait dashboard — your event is already there. You will see cost per task, success rates, and behaviour baselines building automatically.

Event fields reference

FieldTypeRequiredDescription
task_typestringYesWhat the agent did (e.g. email_reply, summarize, classify)
modelstringYesWhich model ran the task (e.g. claude-3.5-sonnet, gpt-4o)
tokens_usednumberYesTotal tokens consumed (input + output)
statusstringYessuccess, failure, or partial
duration_msnumberNoHow long the task took in milliseconds
agent_idstringNoIdentifier for the agent (auto-generated if omitted)
metadataobjectNoAny extra context you want to track

Python example

import requests requests.post('https://clawtrait.com/api/ingest', headers={'X-Agent-Key': 'YOUR_API_KEY'}, json={ 'task_type': 'email_reply', 'model': 'claude-3.5-sonnet', 'tokens_used': 1500, 'status': 'success', 'duration_ms': 2400, } )

cURL example

curl -X POST https://clawtrait.com/api/ingest \ -H "Content-Type: application/json" \ -H "X-Agent-Key: YOUR_API_KEY" \ -d '{ "task_type": "email_reply", "model": "claude-3.5-sonnet", "tokens_used": 1500, "status": "success", "duration_ms": 2400 }'

Next steps