Skip to content
GET/api/v1/traces/{traceId}

Get trace detail

Returns one trace as a waterfall. Path traceId must be a UUID (400 INVALID_ID). Two sources: if ?projectId is supplied, the in-memory OTLP span store is consulted first and returns traceId, rootSpanName, totalDuration, spanCount, services, status, start/end time, a waterfall of spans (spanId, parentSpanId, name, serviceName, duration, relativeStartMs, depth, status, attributes, events) and tokenAnalysis (breakdown + efficiency). Otherwise it falls back to the agent_traces row plus up to 1000 agent_steps, projecting the same field names; on that branch serviceName is empty, attributes/events are empty and tokenAnalysis is omitted (agent_steps has no service, model or context-window data), and it additionally returns steps, parsed, loops and breakdown {costByType, latencyByType, tokensByType{prompt,completion,total}}. Span links are not exposed. Org membership is resolved from the trace row itself, so an unknown trace is 404 with no cross-tenant leak.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Parameters

traceId in pathrequired
string

Response

200 example

{
  "traceId": "string",
  "rootSpanName": "string",
  "duration": 0,
  "spanCount": 0,
  "services": [
    "string"
  ],
  "status": "ok",
  "startTime": 0
}

All status codes

200Trace.
400(no description)
401(no description)
403Forbidden — the credential is valid but lacks the API-key scope, member role, or plan entitlement this operation requires.
404(no description)
429(no description)
500Internal Server Error — DB_ERROR.

Code samples

cURL

# {traceId} is shown with an EXAMPLE value — replace it with real values.
curl -X GET \
  https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000 \
  -H "Authorization: Bearer $EVALGUARD_API_KEY"

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {traceId} is shown with an EXAMPLE value — replace it with real values.

const res = await fetch("https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());

Python

# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {traceId} is shown with an EXAMPLE value — replace it with real values.

import os
import requests

headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}

response = requests.request("GET", "https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000", headers=headers)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
)

// {traceId} is shown with an EXAMPLE value — replace it with real values.
func main() {
	req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/traces/00000000-0000-0000-0000-000000000000", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403404429500

Other Traces endpoints