Reference

Keys

There are four kinds of key. An ingest key sends traces and cannot read them. A secret key also reads. A read-only key reads without writing. A setup-code key is the older write-only key that an agent requests and you approve.

Ingest, secret and read-only keys

Create ingest, secret and read-only keys in your workspace. Create ingest key and show snippets on Home makes an ingest key. API keys makes any of the three. The caller generates the key and sends the server only its SHA-256, so the key is shown once and cannot be recovered.

  • Ingest key (st_pub_…). Write-only. It can upload batches, OTLP spans and Langfuse SDK events to its project and environment. It cannot list, read or export traces.
  • Secret key (st_sec_…). Writes, and reads the traces and events of its own workspace and environment through GET /api/v1/traces, GET /api/v1/traces/{id} and GET /api/v1/traces/{id}/events. It cannot read usage, list keys, workspaces or projects, or reach another workspace or environment. Keep it on a server.
  • Read-only key (st_ro_…). Reads, and never writes. See Read-only keys below. The API keys form offers it, and the signed-in key endpoint can issue one (POST /api/keys/create with key_type: "readonly"). Keep it on a server.
  • No expiry by default. You can choose 30 days, 90 days or 1 year under API keys. The Home card's key has no expiry.
  • Rotate. Rotation issues a replacement of the same kind and keeps the old key working for an overlap window (24 hours by default) so you can deploy the new one.
  • Revoke. Revoking stops new uploads and reads at once; it does not delete stored data.

Send a key as x-supatrace-key: KEY or Authorization: Bearer KEY.

Read-only keys

A read-only key is a typed key with the read scope only: st_ro_ followed by 43 base64url characters. It is not a session credential and never a write key.

  • Reads only its own fence. GET /api/v1/traces, GET /api/v1/traces/{id} and GET /api/v1/traces/{id}/events for its own workspace, project and environment. A workspace, project or environment that names another one is 403 key_scope_denied.
  • Refused everywhere else. Account, workspace, project, usage and key-list routes are 403 key_scope_denied. Every ingest route (batches, OTLP and Langfuse) is refused with 403 and stores nothing.
  • Same lifecycle. It expires, revokes and rotates like the other typed keys. Rotation issues a same-kind st_ro_ replacement and keeps the old key reading through the overlap window.
  • Server-side handling. The server stores only the key's SHA-256, never the key.
curl -H "X-Supatrace-Key: st_ro_REPLACE_WITH_KEY" "https://supatrace.dev/api/v1/traces"

Setup-code keys

Run connect.py from the setup guide. It creates the key on your machine and shows a 12-character setup code. Approve only the code your own terminal just showed you, under Agents in your workspace. Setup codes expire after 10 minutes.

python3 connect.py --project YOUR_PROJECT_ID --config ./supatrace-access.json

The script saves the credentials to the config file you chose, with owner-only permissions. Never commit that file or paste it into chat.

What a setup-code key can do

  • Write-only. A key can upload batches to its project. It cannot list, read or export traces.
  • 30 days. Setup-code keys expire 30 days after approval. Make and approve a new connection to continue, or use an ingest key, which does not expire by default.
  • Active keys: Free 2, Base 10, Pro 25, Enterprise 100 per organization, of all kinds together. See Limits.

Not available yet

  • Management API writes other than creating and revoking keys. See Management API.

Keys in the SDK

The SDK reads SUPATRACE_API_KEY only for OTLP export. Source mode needs no key: it writes local files that you upload with upload.py and your config file. For a first hosted trace, use a stock exporter.