Quickstart
Your first trace
Three ways to send a first trace: from Home, from any OpenTelemetry exporter, or with the reviewed scripts.
1. Send a trace from Home Live
- Sign in. A new workspace shows Send your first trace on Home.
- Select Create ingest key and show snippets. Your browser makes an ingest key (
st_pub_…) and sends the server only its SHA-256. The key is shown once, in curl, Python and Node snippets. - Run one snippet. It posts a small synthetic chat call to
/api/batchesand needs no package install. - The card shows the trace when the upload is accepted. Open it from there.
The ingest key can only send traces. It does not expire by default. Revoke or rotate it under API keys. Keys from pairing an agent last 30 days. See Keys.
2. OTLP from any OpenTelemetry exporter Live
Send OTLP/HTTP traces to supatrace.dev, as protobuf or JSON. No SupaTrace package needed. No gRPC, metrics or logs. Limits are in the OpenTelemetry guide.
In a fresh shell, set these two variables, replacing only YOUR_INGEST_KEY:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://supatrace.dev
export OTEL_EXPORTER_OTLP_HEADERS="x-supatrace-key=YOUR_INGEST_KEY"Both x-supatrace-key: <key> and Authorization: Bearer <key> are accepted. The environment-variable alternative is OTEL_EXPORTER_. Some SDKs require the space URL-encoded: Authorization=Bearer%20YOUR_, following the OpenTelemetry header format.
Try HTTP/JSON
This fake span calls no model provider. Replace the key before sending:
curl -X POST https://supatrace.dev/v1/traces \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_INGEST_KEY' \
-d '{"resourceSpans":[{"scopeSpans":[{"spans":[{"traceId":"11111111111111111111111111111111","spanId":"1111111111111111","name":"synthetic.example","startTimeUnixNano":"1794685870000000000","endTimeUnixNano":"1794685871000000000"}]}]}]}'
# Or replace Authorization with: -H 'x-supatrace-key: YOUR_INGEST_KEY'The base URL makes both stock exporters append /v1/traces. Leave any OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_TRACES_HEADERS overrides unset.
Python
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-httpSave as first-trace.py. It sends one synthetic span over HTTP/protobuf and flushes before exit.
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
provider = TracerProvider()
provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
with trace.get_tracer("first-trace-example").start_as_current_span("synthetic.chat") as span:
span.set_attribute("gen_ai.provider.name", "example")
span.set_attribute("gen_ai.request.model", "synthetic-model")
print("Trace: otlp." + format(span.get_span_context().trace_id, "032x"))
provider.force_flush()
provider.shutdown()python first-trace.pyJavaScript / Node 22
npm install @opentelemetry/sdk-trace-base@2.12.1 @opentelemetry/exporter-trace-otlp-http@0.223.2 @opentelemetry/api@1.9.1These compatible package versions keep the trace SDK and exporter on the same OpenTelemetry API version. Save as first-trace.mjs (ESM). This JavaScript exporter reads the same two environment variables and appends /v1/traces to the base URL. It sends HTTP/JSON.
import { trace } from "@opentelemetry/api";
import { BasicTracerProvider, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
const provider = new BasicTracerProvider({
spanProcessors: [new SimpleSpanProcessor(new OTLPTraceExporter())],
});
trace.setGlobalTracerProvider(provider);
const span = trace.getTracer("first-trace-example").startSpan("synthetic.chat");
span.setAttribute("gen_ai.provider.name", "example");
span.setAttribute("gen_ai.request.model", "synthetic-model");
console.log("Trace: otlp." + span.spanContext().traceId);
span.end();
await provider.forceFlush();
await provider.shutdown();node first-trace.mjsOpen Traces in the workspace and find the printed otlp.<traceid> run. These examples call no model provider.
3. Send a trace with the reviewed scripts Live
Use this when an agent needs your approval. You need Python 3, a terminal and a SupaTrace sign-in. The setup guide has the downloads, steps and recovery notes. The key it creates is write-only, lasts 30 days and can be revoked. See Keys.
SDK availability Beta
Python SDK: Beta. JavaScript SDK: Coming soon. Install with pip install supatrace==0.1.0 (alpha, Python 3.10+). The JavaScript supatrace package is not published to npm. Its examples run from the public repository root.
Python
pip install supatrace==0.1.0import supatrace
trace = supatrace.init(service="checkout", spool="./spool")
result = trace.batch([
{"id": "e1", "time": "2026-11-14T00:00:00Z", "kind": "note", "name": "hello", "data": {"message": "safe"}},
])
print(result["report"]["valid"], result["report"]["path"])JavaScript
npm install ./packages/supatrace-js # from the public repository root. Node 22 or later, ESM onlyimport { init } from "supatrace";
const trace = init("checkout", { spool: "./spool" });
const result = trace.batch([
{ id: "e1", time: "2026-11-14T00:00:00Z", kind: "note", name: "hello", data: { message: "safe" } },
]);
console.log(result.report.valid, result.report.path);Both write the same file for the same batch: spool/<sha256>.json. An event has an id, a time, a kind (request, tool_call, tool_result, response, error or note), a name and a data object. Pass dry_run=True (Python) or dryRun: true (JavaScript) to validate without writing.
Python dry run
import supatrace
trace = supatrace.init(service="checkout", spool="./spool")
report = trace.batch([{"id": "e1", "time": "2026-11-14T00:00:00Z", "kind": "note", "name": "hello", "data": {}}], dry_run=True)["report"]
print(report["valid"], report["errors"], report["path"])Review, then upload
Read the spooled file. Remove anything you do not want stored. Then upload it with the script from the setup guide, using the write-only connection you approved there:
python3 upload.py ./spool/BATCH.json --config ./supatrace-access.jsonThe trace appears under Traces in your workspace. Batch limits apply: 100 events and 512 KiB per batch.