Skip to main content
POST
/
logs
/
spans
Search spans
curl --request POST \
  --url https://api.adaline.ai/v2/logs/spans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "projectId": "<string>",
  "promptId": "<string>",
  "model": "<string>",
  "provider": "<string>",
  "startedAfter": 123,
  "startedBefore": 123,
  "name": "<string>",
  "referenceId": "<string>",
  "sessionId": "<string>",
  "filters": [
    {
      "column": "<string>",
      "operator": "<string>",
      "value": "<unknown>"
    }
  ],
  "limit": 100,
  "cursor": "<string>"
}
'
{
  "pagination": {
    "limit": 123,
    "returned": 1,
    "hasMore": true,
    "nextCursor": "<string>"
  },
  "spans": [
    {
      "id": "<string>",
      "name": "<string>",
      "contentType": "<string>",
      "startedAt": 17450965800000,
      "endedAt": 17450965800000,
      "latency": 123,
      "logTraceId": "<string>",
      "promptId": "<string>",
      "referenceId": "<string>",
      "parentReferenceId": "<string>",
      "sessionId": "<string>",
      "cost": 123,
      "promptTokens": 123,
      "completionTokens": 123,
      "totalTokens": 123,
      "content": "<string>",
      "parsedContent": "<string>",
      "attributes": "<string>",
      "tags": "<string>",
      "events": "<string>",
      "createdAt": 17450965800000,
      "updatedAt": 17450965800000
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt

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

Returns a cursor-paginated page of filtered model span rows for a prompt. Pass nextCursor from the response as cursor to fetch the next page. See Export Logs for filter types, available columns, and pagination conventions.

Authorizations

Authorization
string
header
required

Workspace API key. Pass as Authorization: Bearer <key>.

Body

application/json

Request payload for paginated span search. promptId is optional; when omitted the response includes spans of every content type across the project.

projectId
string
required

The project to search spans in.

Required string length: 20 - 80
promptId
string

Optional. When provided, scopes results to this prompt. Omit to return spans of every content type (Model, Tool, Function, Guardrail, Retrieval, Embeddings, Other, or custom) across all prompts in the project.

Required string length: 20 - 80
model
string

Case-insensitive substring match on the model name.

provider
string

Case-insensitive substring match on the provider name.

startedAfter
integer

Unix timestamp in milliseconds. Only return rows started at or after this time.

startedBefore
integer

Unix timestamp in milliseconds. Only return rows started at or before this time.

status
enum<string>

Filter by status.

Available options:
success,
failure,
aborted,
cancelled,
pending,
unknown
name
string

Case-insensitive substring match on the trace or span name.

referenceId
string

Exact match on the reference ID.

sessionId
string

Exact match on the session ID.

filters
Log Filter Object · object[]

Typed filter objects for advanced queries. ANDed with flat params.

Maximum array length: 20
sort
enum<string>

Sort order. Defaults to startedAt:desc.

Available options:
startedAt:asc,
startedAt:desc
limit
integer

Page size. Defaults to 50, max 200.

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

Opaque pagination cursor from a previous response.

Response

A page of search results with cursor-based pagination metadata.

Paginated search results for log spans.

pagination
Pagination · object
required

Pagination metadata for list endpoints with cursor-based navigation.

spans
Log Span Item · object[]
required

Array of log span items.