Skip to main content
GET
/
v0
/
traces
JavaScript
import Avido from 'avido';

const client = new Avido({
  apiKey: process.env['AVIDO_API_KEY'], // This is the default and can be omitted
  applicationID: process.env['AVIDO_APPLICATION_ID'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const trace of client.traces.list()) {
  console.log(trace.id);
}
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "timestamp": "2025-01-05T12:34:56.789123Z",
      "referenceId": "123e4567-e89b-12d3-a456-426614174000",
      "metadata": {
        "userId": "123",
        "source": "chatbot"
      },
      "testId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "totalCost": 0.0023,
      "totalPromptTokens": 150,
      "totalCompletionTokens": 200,
      "totalDurationMs": 1500,
      "hasError": false,
      "stepCount": 5,
      "steps": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "traceId": "610adba1-7cc0-4fa7-9e2b-8bd2fdf281b2",
          "timestamp": "2025-01-05T12:34:56.789123Z",
          "type": "<string>",
          "status": "success",
          "modelId": "gpt-4o-2024-08-06",
          "event": "<string>",
          "input": "Tell me a joke.",
          "name": "Moderation",
          "group": "inputModeration",
          "params": {},
          "metadata": {},
          "parentId": "456e7890-e89b-12d3-a456-426614174001",
          "endTime": "2025-01-05T12:34:57.123456Z",
          "durationMs": 334,
          "costAmount": 0.0035,
          "statusCode": "200",
          "error": "TimeoutError: Request timed out after 30s"
        }
      ],
      "evals": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "orgId": "org_123456",
          "createdAt": "2024-01-05T12:34:56.789Z",
          "modifiedAt": "2024-01-05T12:34:56.789Z",
          "status": "COMPLETED",
          "definition": {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "createdAt": "2024-01-05T12:34:56.789Z",
            "modifiedAt": "2024-01-05T12:34:56.789Z",
            "type": "NATURALNESS",
            "name": "<string>",
            "globalConfig": {
              "criterion": "<string>"
            },
            "styleGuideId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "application": {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "orgId": "org_123456",
              "title": "Customer Support Bot",
              "slug": "customer-support-bot",
              "description": "AI assistant for customer support inquiries",
              "context": "You are a helpful customer support assistant...",
              "language": "en",
              "type": "CHATBOT",
              "environment": "DEV",
              "createdAt": "2024-01-05T12:34:56.789Z",
              "modifiedAt": "2024-01-05T12:34:56.789Z"
            }
          },
          "results": {
            "coherence": 3,
            "engagingness": 3,
            "naturalness": 3,
            "relevance": 3,
            "clarity": 3,
            "analysis": "<string>"
          },
          "score": 0.9,
          "passed": true
        }
      ]
    }
  ],
  "pagination": {
    "skip": 0,
    "limit": 25,
    "total": 100,
    "totalPages": 4,
    "totalCount": 100
  }
}

Authorizations

x-api-key
string
header
required

Your unique Avido API key

x-application-id
string
header
required

Your unique Avido Application ID

Query Parameters

skip
integer
default:0

Number of items to skip before starting to collect the result set.

Required range: 0 <= x <= 9007199254740991
Example:

0

limit
integer

Number of items to include in the result set.

Required range: 1 <= x <= 100
Example:

25

orderBy
string
default:timestamp

Field to order by in the result set.

Example:

"timestamp"

orderDir
enum<string>
default:desc

Order direction.

Available options:
asc,
desc
Example:

"desc"

testId
string<uuid>

Filter traces by test ID

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"123e4567-e89b-12d3-a456-426614174000"

referenceId
string

Filter traces by reference ID

Example:

"ref-12345"

startDate
string<date-time>

Filter traces created after this date (inclusive).

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-01-01T00:00:00.000Z"

endDate
string<date-time>

Filter traces created before this date (inclusive).

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-31T23:59:59.999Z"

minCost
number

Filter traces with total cost greater than or equal to this value.

Required range: x >= 0
Example:

0.01

maxCost
number

Filter traces with total cost less than or equal to this value.

Required range: x >= 0
Example:

1

minDuration
integer

Filter traces with total duration (ms) greater than or equal to this value.

Required range: 0 <= x <= 9007199254740991
Example:

100

maxDuration
integer

Filter traces with total duration (ms) less than or equal to this value.

Required range: 0 <= x <= 9007199254740991
Example:

5000

hasError
boolean

Filter traces with or without errors.

Example:

true

metadataKey
string

Metadata key to filter on. Must be used together with metadataValue.

Example:

"userId"

metadataValue
string

Metadata value to filter on. Must be used together with metadataKey.

Example:

"user-123"

Full-text search across trace step content fields (input, output, toolInput, toolOutput, content, query, result).

Example:

"error in response"

minScore
number

Filter traces with eval score greater than or equal to this value.

Required range: 0 <= x <= 1
Example:

0.5

maxScore
number

Filter traces with eval score less than or equal to this value.

Required range: 0 <= x <= 1
Example:

0.9

Response

Successfully retrieved traces with steps

Paginated response containing traces

data
Trace · object[]
required
pagination
PaginationResponse · object
required

Pagination metadata returned in a paginated response.