API reference

The public HTTP endpoints, authentication, ingestion event types, and SDK client options.

Currai exposes a small public HTTP surface. The SDKs wrap it for you, but you can call it directly from any language.

Endpoints

EndpointMethodAuthBody
/api/public/ingestionPOSTHTTP Basic{ batch: IngestionEvent[] }
/api/public/otel/v1/tracesPOSTHTTP Basic or BearerOTLP protobuf or JSON
/api/public/healthGETnone

All paths are relative to your baseUrl (default https://currai.app).

Authentication

Ingestion uses HTTP Basic auth — public key as the username, secret key as the password:

Authorization: Basic base64(publicKey:secretKey)

The OTLP endpoint also accepts a Bearer secret key. See Authentication for how to create keys.

Ingestion

POST /api/public/ingestion accepts a batch of events:

{
  "batch": [
    /* IngestionEvent objects */
  ]
}

Each event has a type. The supported types are:

TypeCreates / updates
trace-createa trace
span-createa span observation
span-updatepatches an existing span
generation-createa generation observation
generation-updatepatches an existing generation
event-createa point-in-time event

The server responds with HTTP 207 and a per-event result:

{
  "successes": [
    /* … */
  ],
  "errors": [
    /* … */
  ]
}

This is the same wire format the Langfuse SDKs emit, so a Langfuse client pointed at Currai's baseUrl works unchanged.

Levels

Traces and observations carry a level: one of DEBUG, DEFAULT, WARNING, or ERROR.

SDK client options

TypeScript

OptionDefaultDescription
publicKey(required)Public key (pk-lf-…).
secretKey(required)Secret key (sk-lf-…).
baseUrlhttps://currai.appCurrai instance URL.
enabledtrueWhen false, no events are buffered or sent.
flushAt15Auto-flush when the buffer reaches this many events.
flushInterval10000Background flush interval (ms). 0 disables it.
requestTimeout10000Per-request timeout (ms).
onErrorconsole.warnSink for network / ingestion errors.
fetchglobalThis.fetchOverride for testing or non-standard runtimes.

Python

OptionDefaultDescription
public_key(required)Public key (pk-lf-…).
secret_key(required)Secret key (sk-lf-…).
base_urlhttps://currai.appCurrai instance URL.
enabledTrueWhen False, no events are buffered or sent.
flush_at15Auto-flush when the buffer reaches this many events.
flush_interval_ms10000Background flush interval (ms). 0 disables it.
request_timeout_ms10000Per-request timeout (ms).
on_errorlogging.warningSink for network / ingestion errors.