Skip to main content
AgentHub stores what your agent did as traces. A trace is one run of your agent (one request, one conversation turn, one job). It holds a list of spans, one per step: a model call, a tool call, an HTTP request, a database query, or any function you want to time. You send traces to AgentHub with a plain HTTPS POST. There is no CorePillar SDK package to install. The snippets on this page are ordinary HTTP calls you can copy into any language.
If your agent already emits OpenTelemetry spans (for example through OpenLLMetry, OpenInference or the standard OTel SDKs), you can skip the JSON format entirely and point your exporter at AgentHub. See OpenTelemetry (OTLP).

What you need

  • An AgentHub project. Every trace belongs to exactly one project, chosen by the key you send it with.
  • A tracing key for that project. Creating one needs the manage_org_settings permission, which the Owner and Admin roles have. See Roles and permissions.
  • Anything that can make an HTTPS request: curl, Python, Node.js, or your agent’s own HTTP client.

Steps

1

Create a tracing key

In AgentHub, open Settings and choose Tracing keys.
  1. Pick the Project the traces should land in.
  2. Pick an Environment: Live creates a tk_live_ key, Test creates a tk_test_ key. Both work the same way for ingestion; the prefix just helps you keep production and test credentials apart.
  3. Click + New live key (or + New test key).
  4. Copy the key from the banner with Copy key.
The full key is shown once. AgentHub stores only a SHA-256 hash of it plus a short hint, so it cannot show you the key again. If you lose it, create a new one and revoke the old one.
Keys look like tk_live_ or tk_test_ followed by 48 lowercase hex characters. Full details, including revoking, are in Tracing keys.
2

Store the key outside your code

Treat the key like a password. Put it in an environment variable or your secret manager, never in source control.
The variable name is up to you. The examples below read COREPILLAR_TRACING_KEY.
3

Send your first trace

POST a JSON trace to the ingest endpoint:
Pass the key as a Bearer token. The example sends one trace with two spans: a root agent_run span and a child model call.
The TypeScript example runs on Node.js 18 or later (global fetch and crypto.randomUUID), Deno, Bun, or in an edge runtime. Don’t call the ingest endpoint from a browser: that would expose your tracing key to anyone who opens developer tools.
4

Check the response

A successful ingest returns 202 Accepted:
span_count and status describe the batch you just sent. The trace is stored by the time you get this response, so you can open it straight away.If something is wrong you get an error envelope instead, for example 401 UNAUTHORIZED for a bad key or 400 VALIDATION_ERROR for a malformed payload. See Errors.
5

Find it in Traces

In AgentHub, open the project the key belongs to and click Traces in the sidebar. Your trace appears at the top of the list, newest first, under its root_name. You can also search by trace_id.Open it to see each span with its kind, model, tokens, cost, latency, input and output. The Traces guide walks through the trace view.

Common first-trace problems

Next steps

Trace format

Every field, type, default and limit in the ingest payload.

Idempotency and retries

Retry safely, send a trace in several batches, and handle errors.

OpenTelemetry (OTLP)

Send spans from an existing OpenTelemetry setup with no code changes.

Ingest endpoint reference

The full API reference, including authentication and errors.