OpenTelemetry
Send OTLP spans carrying the gen_ai.* semantic conventions to Currai from any language, and migrate a Langfuse app by changing one URL.
If you're already instrumented with OpenTelemetry, you don't need the Currai SDK. Point your OTLP exporter at Currai's endpoint and your spans become traces and generations — your existing code, spans, and exporters keep working.
The OTLP endpoint
Send OTLP/HTTP traces to:
- Method:
POST - Auth: HTTP Basic (
base64(publicKey:secretKey)) or a Bearer secret key — same credentials as the SDKs (see Authentication). - Body: OTLP
application/x-protobuforapplication/json.
A span is recorded as a generation when it carries any of gen_ai.system, gen_ai.operation.name, or gen_ai.request.model; otherwise it's recorded as a span.
Attributes Currai reads
Currai understands the OpenTelemetry GenAI conventions (plus OpenInference and OpenLLMetry). The most useful keys:
| Attribute | Maps to |
|---|---|
gen_ai.request.model | generation model (for cost) |
gen_ai.usage.input_tokens | input tokens |
gen_ai.usage.output_tokens | output tokens |
gen_ai.usage.total_tokens | total tokens |
gen_ai.request.temperature | model parameter |
gen_ai.request.max_tokens | model parameter |
gen_ai.prompt | generation input |
gen_ai.completion | generation output |
currai.user.id / user.id | trace user |
currai.session.id / session.id | trace session |
currai.tags | trace tags (string array) |
deployment.environment | trace environment (resource attr) |
Example: Rust
Point the standard OTLP/HTTP exporter at Currai, then emit spans with the conventions above. This uses the official opentelemetry, opentelemetry_sdk, and opentelemetry-otlp crates:
Then record a generation:
The same approach works from any OpenTelemetry SDK — Python, Node, Go, Java — just set the endpoint, headers, and the gen_ai.* attributes.
Migrating from Langfuse
Currai is wire-compatible with the Langfuse SDKs. If you're already on Langfuse, change the host and keep your code:
See the full API reference for endpoints, auth, and event types.
currai