Runs

The Runs API endpoint allows you to retrieve data about specific runs from your Lunary application.

The most common run types are 'llm', 'agent', 'chain', 'tool', 'thread' and 'chat'.

It supports various filters to narrow down the results according to your needs.

This endpoint supports GET requests and expects query parameters for filtering the results.

Get Runs

GET/v1/runs
curl -X GET "https://api.lunary.ai/v1/runs?limit=10&type=llm" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <api_key>"

Accepted Keys:

limit
type

Example response for /v1/runs:

{
"data": [
{
"type": "llm",
"name": "gpt-4o",
"createdAt": "2024-01-01T12:00:00Z",
"endedAt": "2024-01-01T12:00:03Z",
"duration": 3,
"tokens": {
"completion": 100,
"prompt": 50,
"total": 150
},
"feedback": null,
"status": "success",
"tags": [
"example"
],
"templateSlug": "example-template",
"templateVersionId": 1234,
"input": [
{
"role": "user",
"content": "Hello world!"
}
],
"output": [
{
"role": "assistant",
"content": "Hello. How are you?"
}
],
"error": null,
"user": {
"id": "11111111",
"externalId": "user123",
"createdAt": "2021-12-01T12:00:00Z",
"lastSeen": "2022-01-01T12:00:00Z",
"props": {
"name": "Jane Doe",
"email": "user1@apple.com"
}
},
"cost": 0.05,
"params": {
"temperature": 0.5,
"maxTokens": 100,
"tools": []
},
"metadata": null
}
],
"total": 200,
"page": 1,
"limit": 10
}

Query Parameters

ParameterTypeRequiredDescription
searchstringNoSearch term for filtering runs.
modelsarrayNoFilter runs by model names.
tagsarrayNoFilter runs by tags.
typearrayNoFilter runs by types: 'llm', 'tool', 'chain', 'agent'.
limitnumberNoMaximum number of results to return. Default is 100.
pagenumberNoPage number for pagination.

Questions? We're here to help.