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
| Endpoint | Method | Auth | Body |
|---|---|---|---|
/api/public/ingestion | POST | HTTP Basic | { batch: IngestionEvent[] } |
/api/public/otel/v1/traces | POST | HTTP Basic or Bearer | OTLP protobuf or JSON |
/api/public/health | GET | none | — |
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:
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:
Each event has a type. The supported types are:
| Type | Creates / updates |
|---|---|
trace-create | a trace |
span-create | a span observation |
span-update | patches an existing span |
generation-create | a generation observation |
generation-update | patches an existing generation |
event-create | a point-in-time event |
The server responds with HTTP 207 and a per-event result:
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
| Option | Default | Description |
|---|---|---|
publicKey | (required) | Public key (pk-lf-…). |
secretKey | (required) | Secret key (sk-lf-…). |
baseUrl | https://currai.app | Currai instance URL. |
enabled | true | When false, no events are buffered or sent. |
flushAt | 15 | Auto-flush when the buffer reaches this many events. |
flushInterval | 10000 | Background flush interval (ms). 0 disables it. |
requestTimeout | 10000 | Per-request timeout (ms). |
onError | console.warn | Sink for network / ingestion errors. |
fetch | globalThis.fetch | Override for testing or non-standard runtimes. |
Python
| Option | Default | Description |
|---|---|---|
public_key | (required) | Public key (pk-lf-…). |
secret_key | (required) | Secret key (sk-lf-…). |
base_url | https://currai.app | Currai instance URL. |
enabled | True | When False, no events are buffered or sent. |
flush_at | 15 | Auto-flush when the buffer reaches this many events. |
flush_interval_ms | 10000 | Background flush interval (ms). 0 disables it. |
request_timeout_ms | 10000 | Per-request timeout (ms). |
on_error | logging.warning | Sink for network / ingestion errors. |
currai