Documentation

REST API

Send usage events to RevenueTrack with simple HTTP calls.

REST API

If you prefer not to use an SDK, you can post events directly to the tracking endpoint.

Endpoint

POST https://track.nearbygpt.app/v1/track

Example request

curl -X POST https://track.nearbygpt.app/v1/track \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $REVENUETRACK_API_KEY" \
  -d '{
    "job": {
      "job_id": "unique-job-id",
      "user_id": "user_123",
      "totals": {
        "prompt_tokens": 100,
        "completion_tokens": 50,
        "total_tokens": 150,
        "events": 1
      }
    },
    "events": [{
      "ts_ms": 1703865600000,
      "provider": "openai",
      "model": "gpt-4o",
      "operation": "chat",
      "prompt_tokens": 100,
      "completion_tokens": 50,
      "latency_ms": 1500,
      "status": "ok"
    }]
  }'

Response

Successful requests return 202 Accepted when events are queued for ingestion.