Get Thread
GEThttps://api.confident-ai.com/v2/threads/{threadId}
Retrieves a thread by id from your Confident AI project, with its evaluation results, annotations and the first 100 traces of the conversation, oldest first.
curl -X GET "https://api.confident-ai.com/v2/threads/{threadId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"id": "thread-42",
"createdAt": "2025-01-15T10:30:00.000Z",
"lastActivity": "2025-01-15T11:45:00.000Z",
"metadata": {
"client": "acme-corp",
"agentId": "geography-agent"
},
"tags": [
"vip"
],
"labels": {
"intent": {
"label": "geography",
"reason": "The user asks for the capital cities of several countries."
}
},
"metricCollectionName": "Conversation Collection Name",
"totalTraces": 2,
"metricsData": [
{
"id": "<METRIC-DATA-ID>",
"name": "Answer Relevancy",
"score": 0.95,
"reason": "The answer directly states the capital of France.",
"success": true,
"threshold": 0.5,
"strictMode": false,
"skipped": false,
"flaky": false,
"evaluationModel": "gpt-4o",
"evaluationCost": 0.0004,
"error": null,
"errorType": "AI_CONNECTION_ERROR",
"createdAt": "2025-01-15T10:30:06.000Z",
"evaluatedAt": "2025-01-15T10:30:09.000Z",
"multiTurn": false
}
],
"annotations": [
{
"id": "<ANNOTATION-ID>",
"rating": 1,
"type": "FIVE_STAR_RATING",
"name": null,
"explanation": "Correct and concise.",
"expectedOutcome": null,
"expectedOutput": "The capital of France is Paris.",
"createdAt": "2025-01-15T11:00:00.000Z",
"user": {
"id": "<USER-ID>",
"email": "jane@acme.com",
"name": "Jane Doe",
"image": null
}
}
],
"traces": [
{
"uuid": "<TRACE-UUID>",
"name": "Geography QA",
"status": "SUCCESS",
"startTime": "2025-01-15T10:30:00.000Z",
"endTime": "2025-01-15T10:30:05.000Z",
"latency": 5000,
"cost": 0.00018,
"threadId": "thread-42",
"userId": "end-user-42",
"environment": "production",
"tags": [
"geography"
],
"metadata": {
"client": "acme-corp"
},
"input": "What is the capital of France?",
"output": "The capital of France is Paris.",
"expectedOutput": "Paris",
"retrievalContext": [
"Paris is the capital and most populous city of France."
],
"context": null,
"toolsCalled": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"expectedTools": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"testCaseId": null,
"metricCollectionName": "Collection Name",
"labels": {
"intent": {
"label": "geography",
"reason": "The user asks for the capital city of a country."
}
},
"spans": [
{
"uuid": "<SPAN-UUID>",
"traceUuid": "<TRACE-UUID>",
"parentUuid": "<PARENT-SPAN-UUID>",
"name": "OpenAI Call",
"type": "SPAN",
"status": "SUCCESS",
"startTime": "2025-01-15T10:30:00.000Z",
"endTime": "2025-01-15T10:30:02.000Z",
"error": null,
"integration": "LangChain",
"provider": "OpenAI",
"model": "gpt-4o",
"endpoint": null,
"cost": 0.00018,
"inputTokenCost": 0.00006,
"outputTokenCost": 0.00012,
"costPerInputToken": 0.0000025,
"costPerOutputToken": 0.00001,
"inputTokenCount": 24,
"outputTokenCount": 12,
"promptAlias": "geography-assistant",
"promptVersion": "00.00.01",
"promptLabel": "production",
"promptCommitHash": "bab04ce",
"embedder": null,
"topK": null,
"chunkSize": null,
"description": null,
"agentHandoffs": null,
"availableTools": null,
"metadata": {
"region": "Europe"
},
"metricCollectionName": "LLM Collection Name",
"input": "What is the capital of France?",
"output": "The capital of France is Paris.",
"expectedOutput": "Paris",
"retrievalContext": [
"Paris is the capital and most populous city of France."
],
"context": null,
"toolsCalled": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"expectedTools": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"metricsData": [
{
"id": "<METRIC-DATA-ID>",
"name": "Answer Relevancy",
"score": 0.95,
"reason": "The answer directly states the capital of France.",
"success": true,
"threshold": 0.5,
"strictMode": false,
"skipped": false,
"flaky": false,
"evaluationModel": "gpt-4o",
"evaluationCost": 0.0004,
"error": null,
"errorType": "AI_CONNECTION_ERROR",
"createdAt": "2025-01-15T10:30:06.000Z",
"evaluatedAt": "2025-01-15T10:30:09.000Z",
"multiTurn": false
}
],
"annotations": [
{
"id": "<ANNOTATION-ID>",
"rating": 1,
"type": "FIVE_STAR_RATING",
"name": null,
"explanation": "Correct and concise.",
"expectedOutcome": null,
"expectedOutput": "The capital of France is Paris.",
"createdAt": "2025-01-15T11:00:00.000Z",
"user": {
"id": "<USER-ID>",
"email": "jane@acme.com",
"name": "Jane Doe",
"image": null
}
}
]
}
],
"metricsData": [
{
"id": "<METRIC-DATA-ID>",
"name": "Answer Relevancy",
"score": 0.95,
"reason": "The answer directly states the capital of France.",
"success": true,
"threshold": 0.5,
"strictMode": false,
"skipped": false,
"flaky": false,
"evaluationModel": "gpt-4o",
"evaluationCost": 0.0004,
"error": null,
"errorType": "AI_CONNECTION_ERROR",
"createdAt": "2025-01-15T10:30:06.000Z",
"evaluatedAt": "2025-01-15T10:30:09.000Z",
"multiTurn": false
}
],
"annotations": [
{
"id": "<ANNOTATION-ID>",
"rating": 1,
"type": "FIVE_STAR_RATING",
"name": null,
"explanation": "Correct and concise.",
"expectedOutcome": null,
"expectedOutput": "The capital of France is Paris.",
"createdAt": "2025-01-15T11:00:00.000Z",
"user": {
"id": "<USER-ID>",
"email": "jane@acme.com",
"name": "Jane Doe",
"image": null
}
}
]
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
threadIdstringRequiredThe id of the thread, as you supplied it when creating its traces.
Response
Get Thread succeeded.
successbooleanIndicates if the request was successful.
dataobjectA thread with its evaluation results, annotations and the traces that make up the conversation.
Show 11 propertiesHide 11 properties
idstringThis is the thread id you supplied when creating the thread.
createdAtstringThis is when the thread was created.
lastActivitystringThis is when the thread was last active.
metadataobject | nullThis is the custom metadata attached to the thread.
tagsarray | nullThis is the list of tags associated with the thread.
labelsobjectThe labels your project's classifiers assigned to the thread, keyed by classifier name.
metricCollectionNamestring | nullThis is the name of the metric collection assigned to evaluate the thread.
totalTracesintegerThis is the total number of traces in this thread.
metricsDatalist of objectsThis is the evaluation metrics data for the thread.
Show 16 propertiesHide 16 properties
idstringThe unique identifier of the metric data entry.
namestringThe name of the metric.
scorenumber | nullThe final metric score, or null when the metric errored or was skipped.
reasonstring | nullThe reason for the metric score, generated by the evaluation model at evaluation time.
successboolean | nullWhether the metric score is above the threshold, or null while the evaluation is still running.
thresholdnumber | nullThe 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.
flakybooleanWhether the metric's verdict was non-deterministic across runs.
evaluationModelstring | nullThe evaluation model used to run the evaluation.
evaluationCostnumber | nullThe cost of running the evaluation in USD.
errorstring | nullThe error message if the evaluation failed.
errorTypeenum | nullWhy an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.
Show 5 enum valuesHide 5 enum values
AI_CONNECTION_ERRORTRANSFORMER_ERROREVALUATION_MODEL_ERRORINVALID_TEST_CASE_PARAMETERSINTERNAL_ERROR
createdAtstringThe time the metric data was created.
evaluatedAtstring | nullThe time the metric was evaluated, or null while it is still running.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
annotationslist of objectsThis is the list of annotations associated with the thread.
Show 9 propertiesHide 9 properties
idstringThis is the id of the annotation generated by Confident AI.
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
FIVE_STAR_RATINGTHUMBS_RATING
namestring | nullThe name of the annotation.
explanationstring | nullThis is the explanation for the annotation.
expectedOutcomestring | nullThis is the annotated expected outcome, for conversation annotations.
expectedOutputstring | nullThis is the annotated expected output, for span and trace annotations.
createdAtstringThe timestamp when the annotation was created.
userobject | nullA Confident AI user, as referenced by the records they created.
Show 4 propertiesHide 4 properties
idstringThis is the id of the user.
emailstringThis is the email address of the user.
namestring | nullThis is the display name of the user, or null when they have not set one.
imagestring | nullThis is the URL of the user's avatar, or null when they have none.
traceslist of objectsThis is the list of traces in this thread, oldest first and capped at the first 100. Each trace carries its evaluation results and annotations but not its spans.
Show 25 propertiesHide 25 properties
uuidstringThis is the unique identifier of the trace.
namestring | nullThis is the name of the trace.
statusenumThis represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.
Show 2 enum valuesHide 2 enum values
SUCCESSERRORED
startTimestringThis is the time the trace started.
endTimestringThis is the time the trace ended.
latencyintegerThis is how long the trace took, in milliseconds.
costnumber | nullThis is the total cost of the trace in USD, summed from its spans, or null when it is not known.
threadIdstring | nullThis is the thread id of the trace, which groups traces in the same thread into a conversation, or null when the trace is not part of one.
userIdstring | nullThis is the user id you provided for this trace, or null when you did not.
environmentenumThis is the environment where your trace was posted, which helps with separating and debugging traces from different environments on the Confident AI platform.
Show 4 enum valuesHide 4 enum values
productiondevelopmentstagingtesting
tagsarray | nullThis is the list of tags associated with the trace, which is useful for grouping and filtering for traces.
metadataobject | nullThis is any additional metadata associated with the trace.
inputstring | nullThis is the input to the trace. JSON inputs are serialized to a string.
outputstring | nullThis is the output of the trace. JSON outputs are serialized to a string.
expectedOutputstring | nullThis is the expected output associated with the trace, to be used for evaluations.
retrievalContextarray | nullThis is the retrieval context associated with the trace, to be used for evaluations.
contextarray | nullThis is the ideal retrieval context associated with the trace, to be used for evaluations.
toolsCalledarray | nullThis is the list of tools called by the trace, to be used for evaluations.
Show 6 propertiesHide 6 properties
namestringThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolsarray | nullThis is the list of expected tools associated with the trace, to be used for evaluations.
Show 6 propertiesHide 6 properties
namestringThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
testCaseIdstring | nullThis is the test case id of the trace, which is only set if the trace was created while evaluating a test case.
metricCollectionNamestring | nullThis is the name of the metric collection assigned to evaluate the trace.
labelsobjectThe labels your project's classifiers assigned to the trace, keyed by classifier name.
spanslist of objectsThis is the list of spans in the trace, present when the trace is retrieved by id. A thread's traces omit their spans.
Show 41 propertiesHide 41 properties
uuidstringThis is the unique identifier of the span.
traceUuidstringThis is the uuid of the trace containing the span.
parentUuidstring | nullThis is the uuid of the parent span, or null for a root span.
namestring | nullThis is the name of the span.
typeenumThe kind of work a span records: SPAN for a plain step, LLM for a model call, RETRIEVER for a knowledge-base lookup, TOOL for a tool call, and AGENT for an agent step.
Show 5 enum valuesHide 5 enum values
SPANAGENTTOOLRETRIEVERLLM
statusenumThis represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.
Show 2 enum valuesHide 2 enum values
SUCCESSERRORED
startTimestringThis is the time the span started.
endTimestringThis is the time the span ended.
errorstring | nullThis is the error string that caused the span to fail, or null when no error occurred.
integrationstring | nullThis is the integration associated with the span.
providerstring | nullThis is the LLM provider used in an LLM span.
modelstring | nullThis is the LLM model used in an LLM span.
endpointstring | nullThis is the API endpoint the model was called through in an LLM span.
costnumber | nullThis is the total cost of the span in USD, or null when it is not known.
inputTokenCostnumber | nullThis is the total cost of the input tokens passed to the LLM model in an LLM span.
outputTokenCostnumber | nullThis is the total cost of the output tokens generated by the LLM model in an LLM span.
costPerInputTokennumber | nullThis is the cost per input token of the LLM model for an LLM span.
costPerOutputTokennumber | nullThis is the cost per output token of the LLM model for an LLM span.
inputTokenCountinteger | nullThis is the total number of input tokens passed to the LLM model in an LLM span.
outputTokenCountinteger | nullThis is the total number of output tokens generated by the LLM model in an LLM span.
promptAliasstring | nullThis is the alias of your prompt which is stored on Confident AI.
promptVersionstring | nullThis is the version assigned to your prompt on Confident AI.
promptLabelstring | nullThis is the label assigned to a specific version of prompt on the Confident AI platform.
promptCommitHashstring | nullThis is the hash of the current prompt being logged in the llm span.
embedderstring | nullThis is the embedder model used in a retriever span.
topKinteger | nullThis is the top K chunks retrieved from your knowledge base in a retriever span.
chunkSizeinteger | nullThis is the chunk size of each retrieved context for a retriever span.
descriptionstring | nullThis is a description if the span is a tool span.
agentHandoffsarray | nullThis is the list of agent handoffs associated with an agent span.
availableToolsarray | nullThis is the list of available tools associated with an agent span.
metadataobject | nullThis is any additional metadata associated with the span.
metricCollectionNamestring | nullThis is the name of the metric collection to evaluate the span.
inputstring | nullThis is the input to the span. JSON inputs are serialized to a string.
outputstring | nullThis is the output of the span. JSON outputs are serialized to a string.
expectedOutputstring | nullThis is the expected output of your span, which is the ideal actual output and to be used for evaluation.
retrievalContextarray | nullThis is the retrieval context of your span, which is to be used for evaluation.
contextarray | nullThis is the ideal retrieval context of your span, which is to be used for evaluation.
toolsCalledarray | nullThis is the tools called by your span, which is to be used for evaluation.
Show 6 propertiesHide 6 properties
namestringThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolsarray | nullThis is the expected tools to be called by the span, which is to be used for evaluation.
Show 6 propertiesHide 6 properties
namestringThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis 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 16 propertiesHide 16 properties
idstringThe unique identifier of the metric data entry.
namestringThe name of the metric.
scorenumber | nullThe final metric score, or null when the metric errored or was skipped.
reasonstring | nullThe reason for the metric score, generated by the evaluation model at evaluation time.
successboolean | nullWhether the metric score is above the threshold, or null while the evaluation is still running.
thresholdnumber | nullThe 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.
flakybooleanWhether the metric's verdict was non-deterministic across runs.
evaluationModelstring | nullThe evaluation model used to run the evaluation.
evaluationCostnumber | nullThe cost of running the evaluation in USD.
errorstring | nullThe error message if the evaluation failed.
errorTypeenum | nullWhy an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.
Show 5 enum valuesHide 5 enum values
AI_CONNECTION_ERRORTRANSFORMER_ERROREVALUATION_MODEL_ERRORINVALID_TEST_CASE_PARAMETERSINTERNAL_ERROR
createdAtstringThe time the metric data was created.
evaluatedAtstring | nullThe time the metric was evaluated, or null while it is still running.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
annotationslist of objectsThis is the list of annotations associated with the span.
Show 9 propertiesHide 9 properties
idstringThis is the id of the annotation generated by Confident AI.
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
FIVE_STAR_RATINGTHUMBS_RATING
namestring | nullThe name of the annotation.
explanationstring | nullThis is the explanation for the annotation.
expectedOutcomestring | nullThis is the annotated expected outcome, for conversation annotations.
expectedOutputstring | nullThis is the annotated expected output, for span and trace annotations.
createdAtstringThe timestamp when the annotation was created.
userobject | nullA Confident AI user, as referenced by the records they created.
Show 4 propertiesHide 4 properties
idstringThis is the id of the user.
emailstringThis is the email address of the user.
namestring | nullThis is the display name of the user, or null when they have not set one.
imagestring | nullThis is the URL of the user's avatar, or null when they have none.
metricsDatalist of objectsThis is the list of metrics data associated with the trace after running evaluations.
Show 16 propertiesHide 16 properties
idstringThe unique identifier of the metric data entry.
namestringThe name of the metric.
scorenumber | nullThe final metric score, or null when the metric errored or was skipped.
reasonstring | nullThe reason for the metric score, generated by the evaluation model at evaluation time.
successboolean | nullWhether the metric score is above the threshold, or null while the evaluation is still running.
thresholdnumber | nullThe 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.
flakybooleanWhether the metric's verdict was non-deterministic across runs.
evaluationModelstring | nullThe evaluation model used to run the evaluation.
evaluationCostnumber | nullThe cost of running the evaluation in USD.
errorstring | nullThe error message if the evaluation failed.
errorTypeenum | nullWhy an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.
Show 5 enum valuesHide 5 enum values
AI_CONNECTION_ERRORTRANSFORMER_ERROREVALUATION_MODEL_ERRORINVALID_TEST_CASE_PARAMETERSINTERNAL_ERROR
createdAtstringThe time the metric data was created.
evaluatedAtstring | nullThe time the metric was evaluated, or null while it is still running.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
annotationslist of objectsThis is the list of annotations associated with the trace.
Show 9 propertiesHide 9 properties
idstringThis is the id of the annotation generated by Confident AI.
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
FIVE_STAR_RATINGTHUMBS_RATING
namestring | nullThe name of the annotation.
explanationstring | nullThis is the explanation for the annotation.
expectedOutcomestring | nullThis is the annotated expected outcome, for conversation annotations.
expectedOutputstring | nullThis is the annotated expected output, for span and trace annotations.
createdAtstringThe timestamp when the annotation was created.
userobject | nullA Confident AI user, as referenced by the records they created.
Show 4 propertiesHide 4 properties
idstringThis is the id of the user.
emailstringThis is the email address of the user.
namestring | nullThis is the display name of the user, or null when they have not set one.
imagestring | nullThis is the URL of the user's avatar, or null when they have none.
deprecatedbooleanIndicates if this endpoint is deprecated.