List Spans
GEThttps://api.confident-ai.com/v1/spans
Retrieves a list of spans from your Confident AI project.
curl -X GET "https://api.confident-ai.com/v1/spans" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"spans": [
{
"id": "SPAN-ID",
"uuid": "SPAN-UUID",
"name": "Span Name",
"startTime": "2025-01-15T10:30:00Z",
"endTime": "2025-01-15T10:30:05Z",
"traceUuid": "TRACE-UUID",
"status": "SUCCESS",
"type": "LLM",
"provider": "OpenAI",
"integration": "LangChain",
"model": "gpt-4o"
}
],
"totalSpans": 1
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Query parameters
pageintegerThis specifies the page number of the threads to return. Defaulted to 1.
pageSizeintegerThis specifies the maximum number of threads per page. Defaulted to 25.
typeenumFilter by the specific type of span.
traceUuidstringFilter spans that belong to a specific trace UUID.
namestringFilter spans by their exact name.
hasErrorbooleanFilter for spans that either failed (true) or succeeded (false).
modelstringFilter LLM spans by the model used (e.g., 'gpt-4').
promptAliasstringThis filters the spans by the prompt alias used.
promptCommitHashstringThis filters the spans by the exact prompt commit hash used.
promptVersionstringThis filters the spans by the prompt version used.
promptLabelstringThis filters the spans by the prompt label used.
embedderstringFilter retriever spans by the embedder model used.
topKintegerFilter retriever spans by the topK value.
chunkSizeintegerFilter retriever spans by the chunk size.
environmentstringThis filters the threads by the environment where the thread was created, and returns threads from all environments if not specified.
startstringThis filters for threads created after the specified start datetime. Defaulted to 30 days ago.
endstringThis filters for threads created before the specified end datetime. Defaulted to the current time.
sortByenumThis determines the field to sort by. Defaulted to
lastActivity.ascendingenumThis determines if the field specified in
sortByshould be in ascending order. Defaults tofalse.
Response
successbooleanThis is true if the spans were successfully retrieved.
dataobjectThe payload containing the paginated spans and total count.
Show 2 propertiesHide 2 properties
spanslist of objectsThe list of spans for the current page.
Show 37 propertiesHide 37 properties
idstringThis is the id of the span generated by Confident AI, not to be confused with the uuid of the span.
uuidstringThis is the uuid of the span, not to be confused with the span id.
namestringThis is the name of the span.
inputanyThis is the input to the span.
outputanyThis is the output of the span.
errorstringThis is the error string that caused the span to fail, if an error occurred.
parentUuidstringThis is the uuid of the parent span, if any.
startTimestringThis is the time the span started.
endTimestringThis is the time the span ended.
traceUuidstringThis is the uuid of the trace containing the span.
agentHandoffslist of unknownThis is the list of agent handoffs associated with an agent span.
availableToolslist of unknownThis is the list of available tools associated with an agent span.
chunkSizeintegerThis is the chunk size of each retrieved context for a retriever span.
costPerInputTokennumberThis is the cost per input token of the LLM model for an LLM span.
costPerOutputTokennumberThis is the cost per output token of the LLM model for an LLM span.
descriptionstringThis is a description if the span is a tool span.
embedderstringThis is the embedder model used in a retriever span.
inputTokenCostnumberThis is the total cost of the input tokens passed to the LLM model in an LLM span.
inputTokenCountintegerThis is the total number of input tokens passed to the LLM model in an LLM span.
modelstringThis is the LLM model used in an LLM span.
providerstringThis is the LLM provider used in an LLM span.
integrationstringThis is the integration associated with the span.
outputTokenCostnumberThis is the total cost of the output tokens generated by the LLM model in an LLM span.
outputTokenCountintegerThis is the total number of output tokens generated by the LLM model in an LLM span.
statusenumThis is the error status of the span.
Show 3 enum valuesHide 3 enum values
SUCCESSFAILEDPENDING
topKintegerThis is the top K chunks retrieved from your knowledge base.
typestringThis is the type of the span.
metricCollectionNamestringThis is the name of the metric collection to evaluate the span.
retrievalContextlist of stringsThis is the retrieval context of your span, which is to be used for evaluation.
contextlist of stringsThis is the ideal retrieval context of your span, which is to be used for evaluation.
expectedOutputstringThis is the expected output of your span, which is the ideal actual output and to be used for evaluation.
toolsCalledlist of objectsThis is the tools called by your span, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the expected tools to be called by the span, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
metricsDatalist of objectsThis is the metrics data associated with the span.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
annotationobjectThis is the text annotation for the span.
Show 14 propertiesHide 14 properties
idstringThis is the id of the annotation generated by Confident AI, not to be confused with the alias you supplied or version number.
ratingintegerThis is the annotated rating score.
typeenumThis is the type of annotation, which can be either thumbs rating or five star rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringThe name of the annotation.
expectedOutcomestringThis is the annotated expected outcome, for conversation annotations.
expectedOutputstringThis is the annotated expected output, for span and trace annotations.
explanationstringThis is the explanation for the annotation.
createdAtstringThe timestamp when the annotation was created.
traceUuidstringThe UUID of the trace associated with this annotation, if applicable.
spanUuidstringThe UUID of the span associated with this annotation, if applicable.
threadIdstringThe ID of the thread associated with this annotation, if applicable.
testCaseIdstringThe ID of the test case associated with this annotation, if applicable.
userobjectThe user who created this annotation.
Show 4 propertiesHide 4 properties
idstringThe id of the user.
emailstringThe email address of the user.
namestringThe name of the user.
imagestringThe image of the user.
userEmailstringThe email address of the user created this annotation. The field is being deprecated. Please use
user.emailinstead.
environmentenumThis is the environment where your span was posted, which helps with separating and debugging spans from different environments on the Confident AI platform.
Show 4 enum valuesHide 4 enum values
productiondevelopmentstagingtesting
metadataobjectThis is any additional metadata associated with the span.
totalSpansintegerThe total number of spans matching the query across all pages.
deprecatedbooleanThis is true if this endpoint is deprecated.