Skip to main content
POST
/
v2
/
spans
List spans
curl --request POST \
  --url https://api.arize.com/v2/spans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "project_id": "my-project",
  "start_time": "2024-01-01T00:00:00Z",
  "end_time": "2024-01-02T00:00:00Z",
  "filter": "status_code = 'ERROR'"
}
EOF
{
  "data": [
    {
      "name": "llm.chat.completion",
      "context": {
        "trace_id": "trace_001",
        "span_id": "span_001"
      },
      "kind": "LLM",
      "parent_id": "span_000",
      "status_code": "OK",
      "start_time": "2024-01-01T12:00:00Z",
      "end_time": "2024-01-01T12:00:01Z",
      "attributes": {
        "llm.model_name": "gpt-4o",
        "llm.token_count.prompt": 150,
        "llm.token_count.completion": 50
      }
    }
  ],
  "pagination": {
    "next_cursor": "cursor_12345",
    "has_more": true
  }
}

Authorizations

Authorization
string
header
required

Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format

Query Parameters

limit
integer
default:50

Maximum items to return

Required range: 1 <= x <= 500
cursor
string

Opaque pagination cursor returned from a previous response (pagination.next_cursor). Treat it as an unreadable token; do not attempt to parse or construct it.

Body

application/json

Body containing span query parameters

project_id
string
required

The project ID to list spans for

start_time
string<date-time>

Filter to spans starting at or after this timestamp (inclusive). ISO 8601 format (e.g., 2024-01-01T00:00:00Z).

end_time
string<date-time>

Filter to spans starting before this timestamp (exclusive). ISO 8601 format (e.g., 2024-01-02T00:00:00Z).

filter
string

Filter expression to apply to the query. Supports SQL-like syntax for filtering spans by attributes (e.g., status_code = 'ERROR').

Response

Returns a list of spans

data
object[]
required

A list of spans

pagination
object
required

Pagination metadata for cursor-based navigation