/docs/sdks/curl

cURL & raw HTTP

obsrv speaks plain HTTP. If you ship in Go, Ruby, Java, or anything else, you can talk to the API directly — every endpoint accepts JSON over HTTPS.

Send a trace

curl -X POST https://api.obsrv.tech/v1/traces \
  -H "x-api-key: $THETA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "checkout",
    "run_type": "prod",
    "steps": [{
      "name": "plan",
      "type": "llm",
      "model": "claude-sonnet-4-6",
      "messages": [
        { "role": "user", "content": [{ "type": "text", "text": "Buy milk" }] }
      ],
      "token_usage": { "input": 900, "output": 120 }
    }],
    "metadata": { "user_id": "u_a72c", "release": "v3.2.1" }
  }'

Append a step

For long-running runs, you can post NDJSON-encoded steps incrementally rather than committing the full trace at the end.

curl -X POST https://api.obsrv.tech/v1/traces/tr_…/steps \
  -H "x-api-key: $THETA_API_KEY" \
  -H "Content-Type: application/x-ndjson" \
  --data-binary @steps.ndjson

Upload media

Media uploads proxy through the API so the browser and your services never need direct object-storage credentials.

curl -X POST https://api.obsrv.tech/v1/media/upload \
  -H "x-api-key: $THETA_API_KEY" \
  -F "trace_id=tr_…" \
  -F "step_id=st_…" \
  -F "kind=image" \
  -F "file=@./screenshot.png"

List traces

GET /v1/traces?meta_key=release&meta_value=v3.2.1&status=error&limit=50&cursor=…
x-api-key: tk_live_…

Read a trace

GET /v1/traces/tr_…
x-api-key: tk_live_…