Skip to main content
GET
/
api
/
public
/
v2
/
traces
/
{trace_id}
Get Trace
curl --request GET \
  --url https://api.promptlayer.com/api/public/v2/traces/{trace_id} \
  --header 'X-API-KEY: <api-key>'
{
  "success": true,
  "trace_id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
  "spans": [
    {
      "id": 1,
      "name": "llm_call",
      "span_id": "1a2b3c4d5e6f7a8b",
      "parent_id": null,
      "request_log_id": 12345,
      "start_time": "2024-04-03T20:57:25Z",
      "end_time": "2024-04-03T20:57:26Z"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve all spans for a trace ID. Each span includes its metadata and, when the span generated a request log, the associated request_log_id.

Authorizations

X-API-KEY
string
header
required

Path Parameters

trace_id
string
required

The trace ID to retrieve spans for.

Response

Trace detail.

success
enum<boolean>
required
Available options:
true
trace_id
string
required
spans
object[]
required

Spans in this trace. Spans that created request logs include request_log_id.