Mojule Docs

API Reference

Mojule exposes an OTLP/HTTP receiver. Anthropic's OTEL exporters send usage telemetry to it directly — there is no Mojule SDK or setup-exchange endpoint to call.

Endpoints

The collector terminates bearer auth and forwards to the ingest routes. Point your OTEL exporter at the base endpoint; the signal- specific paths are /v1/logs, /v1/metrics, and /v1/traces.

Ingest routes

text
Base    https://ingest.mojule.cloud
Logs    POST /api/ingest/otlp/logs       (alias /v1/logs)
Metrics POST /api/ingest/otlp/metrics    (alias /v1/metrics)
Traces  POST /api/ingest/otlp/traces     (alias /v1/traces)

Authentication

Every request must carry your org ingest token as a bearer header. The token resolves to one organization; all rows are written under that tenant. Unauthenticated requests are dropped with 401 before any write.

Headers

text
Authorization: Bearer mtk_...
Content-Type: application/json

Transport

Mojule accepts OTLP over HTTP/JSON only. Set OTEL_EXPORTER_OTLP_PROTOCOL=http/json. A protobuf body is rejected with 415.

Example: post an OTLP/JSON log batch

bash
curl -X POST https://ingest.mojule.cloud/v1/logs \
  -H "Authorization: Bearer mtk_..." \
  -H "Content-Type: application/json" \
  --data @logs.json

Content contract

Mojule stores the full payload: usage metadata (models, token counts, cost, tool names, session timing, the signed-in seat) and verbatim session content (prompts, tool inputs and parameters, commands, file paths). Content-bearing attributes are split out at ingest and stored encrypted (app-layer AES-256-GCM), retained for the org-configured window (default 90 days) and then purged, and readable only by org admins and the session's own user — every content read is audit-logged. Usage attributes stay queryable plaintext. Nothing is rejected for carrying content; batches return 202 and persist as sent.

Response

A successful batch returns 202 with counts. Individually malformed records are skipped (counted in skipped), never fatal — only genuine transport/DB failures trigger the collector's retry path.

202 body

json
{
  "accepted": true,
  "counts": { "logEvents": 128, "metricPoints": 0 },
  "sessionIds": ["..."],
  "skipped": 0
}

Status codes

202 Accepted
Batch accepted. Body carries per-signal counts.
400 Bad Request
Body was not valid JSON.
401 Unauthorized
Missing or invalid bearer token. No rows are written.
415 Unsupported Media Type
Non-JSON body. Set OTEL_EXPORTER_OTLP_PROTOCOL=http/json.
503 Service Unavailable
On-prem license policy paused ingestion. Dashboards and exports stay available.