Reference

API reference

The public HTTP endpoints, authentication, ingestion event types, prompt management, 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/promptsGETHTTP Basic— (query: name, version?, label?, type?)
/api/public/promptsPOSTHTTP Basic{ name, type?, prompt, config?, tags?, labels?, commitMessage? }
/api/public/healthGETnone

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

Authentication

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

code
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:

code
{
  "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:

code
{
  "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://www.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://www.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.

Client methods

The constructed client exposes the same surface in both languages — only the casing differs (camelCase in TypeScript, snake_case in Python).

TypeScriptPythonReturnsDescription
trace(options?)trace(**kwargs)CurraiTraceStart a trace. Synchronous — buffers a trace-create event.
getPrompt(name, opts?)get_prompt(name, …)CurraiPromptasync — fetch a managed prompt (resolves A/B / production).
createPrompt(body)create_prompt(body)CurraiPromptasync — create a new version of a managed prompt.
flushAsync()flush_async()voidasync — flush the buffer; await before a process exits.
flush()NonePython only — synchronous flush for non-async call sites.
shutdownAsync()shutdown_async()voidasync — flush and stop the background flusher.
shutdown()NonePython only — synchronous shutdown.

getPrompt/get_prompt take an options object (version?, label?, type?) to pin a specific version, label, or prompt type; with none, the server resolves an active A/B experiment, then the production label, then the latest version.