Get agent instance detail
GET/api/v2/agent/:agentCode/instance/:agentInstanceId
Gets the detail of a single system-agent instance (Chat / Activity / AIProxyRequest). The base response always includes the instance request and response; use include to expand optional execution sections (input, skills, knowledge, citations, costBreakdown), each loaded only when requested.
Request
Path Parameters
The unique code identifying the agent the instance belongs to.
The instance id.
Query Parameters
Comma-separated list of optional sections to include: input (the full set of inputs the instance
received), skills, knowledge, citations, costBreakdown (the usage and cost of every execution in the chain,
as a tree). Each section is loaded only when requested.
Use this param to override the culture of the response. Options: - en (default) - es
Responses
- 200
- 401
- 403
- 404
- 500
OK
- text/plain
- application/json
- text/json
- Schema
- Example (from schema)
Schema
Array [
]
Array [
- KnowledgeFile
- KnowledgeWebsite
- WebSearch
]
Array [
]
Array [
Array [
]
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
links
object[]
nullable
usage
object
The token usage of an instance.
costs
object
The cost of an instance, in the tenant's currency.
The cost of the sub agents the instance executed, already counted in total.
The cost of the whole chain: the instance's own tokens and services plus subAgents.
citations
object[]
nullable
The Citations retrieved during the instance.
Populated only when include=citations is requested.
source
object
nullable
oneOf
input
object[]
nullable
The full set of inputs the instance received during its execution, as key/value parameters.
Populated only when include=input is requested.
skills
object[]
nullable
The skills (plugins) executed during the instance.
Populated only when include=skills is requested.
input
object[]
nullable
usage
object
knowledge
object[]
nullable
The knowledge retrieved during the instance.
Populated only when include=knowledge is requested.
costBreakdown
object
The usage and cost of one execution of the chain. Every figure is the node's own, excluding its
descendants, which hang off subAgents.
usage
object
The token usage of an instance.
cost
object
Sum of prompt and completion, without the services or the sub agents.
services
object
transcription
object[]
nullable
usage
object
cost
object
embeddings
object[]
nullable
usage
object
cost
object
images
object[]
nullable
usage
object
cost
object
subAgents
object[]
nullable
{
"links": [
{
"method": "string",
"url": "string",
"rel": "string"
}
],
"id": "string",
"name": "string",
"agentVersion": 0,
"startDate": "2024-07-29T15:51:28.071Z",
"endDate": "2024-07-29T15:51:28.071Z",
"timeToFirstToken": 0,
"timeToFirstContent": 0,
"channel": "string",
"userIdentifier": "string",
"groupIdentifier": "string",
"ipAddress": "string",
"userAgent": "string",
"origin": "string",
"referer": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"costs": {
"prompt": 0,
"completion": 0,
"services": 0,
"subAgents": 0,
"total": 0,
"currency": "string"
},
"canceledByClient": true,
"citations": [
{
"citationIndex": 0,
"startIndex": 0,
"endIndex": 0,
"relevance": 0,
"source": {},
"citedText": "string"
}
],
"type": "string",
"request": "string",
"response": "string",
"input": [
{
"key": "string"
}
],
"skills": [
{
"name": "string",
"tool": "string",
"input": [
{
"key": "string"
}
],
"output": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"success": true,
"error": "string",
"iteration": 0,
"durationMs": 0,
"startDate": "2024-07-29T15:51:28.071Z"
}
],
"knowledge": [
{
"fileId": "string",
"fileName": "string",
"content": "string",
"relevance": 0,
"pageFrom": 0,
"pageTo": 0,
"position": 0,
"totalTokenCount": 0
}
],
"costBreakdown": {
"instanceId": "string",
"agentId": "string",
"agentCode": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
},
"services": {
"transcription": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"embeddings": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"images": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
]
},
"subAgents": [
{}
]
}
}
- Schema
- Example (from schema)
Schema
Array [
]
Array [
- KnowledgeFile
- KnowledgeWebsite
- WebSearch
]
Array [
]
Array [
Array [
]
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
links
object[]
nullable
usage
object
The token usage of an instance.
costs
object
The cost of an instance, in the tenant's currency.
The cost of the sub agents the instance executed, already counted in total.
The cost of the whole chain: the instance's own tokens and services plus subAgents.
citations
object[]
nullable
The Citations retrieved during the instance.
Populated only when include=citations is requested.
source
object
nullable
oneOf
input
object[]
nullable
The full set of inputs the instance received during its execution, as key/value parameters.
Populated only when include=input is requested.
skills
object[]
nullable
The skills (plugins) executed during the instance.
Populated only when include=skills is requested.
input
object[]
nullable
usage
object
knowledge
object[]
nullable
The knowledge retrieved during the instance.
Populated only when include=knowledge is requested.
costBreakdown
object
The usage and cost of one execution of the chain. Every figure is the node's own, excluding its
descendants, which hang off subAgents.
usage
object
The token usage of an instance.
cost
object
Sum of prompt and completion, without the services or the sub agents.
services
object
transcription
object[]
nullable
usage
object
cost
object
embeddings
object[]
nullable
usage
object
cost
object
images
object[]
nullable
usage
object
cost
object
subAgents
object[]
nullable
{
"links": [
{
"method": "string",
"url": "string",
"rel": "string"
}
],
"id": "string",
"name": "string",
"agentVersion": 0,
"startDate": "2024-07-29T15:51:28.071Z",
"endDate": "2024-07-29T15:51:28.071Z",
"timeToFirstToken": 0,
"timeToFirstContent": 0,
"channel": "string",
"userIdentifier": "string",
"groupIdentifier": "string",
"ipAddress": "string",
"userAgent": "string",
"origin": "string",
"referer": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"costs": {
"prompt": 0,
"completion": 0,
"services": 0,
"subAgents": 0,
"total": 0,
"currency": "string"
},
"canceledByClient": true,
"citations": [
{
"citationIndex": 0,
"startIndex": 0,
"endIndex": 0,
"relevance": 0,
"source": {},
"citedText": "string"
}
],
"type": "string",
"request": "string",
"response": "string",
"input": [
{
"key": "string"
}
],
"skills": [
{
"name": "string",
"tool": "string",
"input": [
{
"key": "string"
}
],
"output": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"success": true,
"error": "string",
"iteration": 0,
"durationMs": 0,
"startDate": "2024-07-29T15:51:28.071Z"
}
],
"knowledge": [
{
"fileId": "string",
"fileName": "string",
"content": "string",
"relevance": 0,
"pageFrom": 0,
"pageTo": 0,
"position": 0,
"totalTokenCount": 0
}
],
"costBreakdown": {
"instanceId": "string",
"agentId": "string",
"agentCode": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
},
"services": {
"transcription": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"embeddings": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"images": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
]
},
"subAgents": [
{}
]
}
}
- Schema
- Example (from schema)
Schema
Array [
]
Array [
- KnowledgeFile
- KnowledgeWebsite
- WebSearch
]
Array [
]
Array [
Array [
]
]
Array [
]
Array [
]
Array [
]
Array [
]
Array [
]
links
object[]
nullable
usage
object
The token usage of an instance.
costs
object
The cost of an instance, in the tenant's currency.
The cost of the sub agents the instance executed, already counted in total.
The cost of the whole chain: the instance's own tokens and services plus subAgents.
citations
object[]
nullable
The Citations retrieved during the instance.
Populated only when include=citations is requested.
source
object
nullable
oneOf
input
object[]
nullable
The full set of inputs the instance received during its execution, as key/value parameters.
Populated only when include=input is requested.
skills
object[]
nullable
The skills (plugins) executed during the instance.
Populated only when include=skills is requested.
input
object[]
nullable
usage
object
knowledge
object[]
nullable
The knowledge retrieved during the instance.
Populated only when include=knowledge is requested.
costBreakdown
object
The usage and cost of one execution of the chain. Every figure is the node's own, excluding its
descendants, which hang off subAgents.
usage
object
The token usage of an instance.
cost
object
Sum of prompt and completion, without the services or the sub agents.
services
object
transcription
object[]
nullable
usage
object
cost
object
embeddings
object[]
nullable
usage
object
cost
object
images
object[]
nullable
usage
object
cost
object
subAgents
object[]
nullable
{
"links": [
{
"method": "string",
"url": "string",
"rel": "string"
}
],
"id": "string",
"name": "string",
"agentVersion": 0,
"startDate": "2024-07-29T15:51:28.071Z",
"endDate": "2024-07-29T15:51:28.071Z",
"timeToFirstToken": 0,
"timeToFirstContent": 0,
"channel": "string",
"userIdentifier": "string",
"groupIdentifier": "string",
"ipAddress": "string",
"userAgent": "string",
"origin": "string",
"referer": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"costs": {
"prompt": 0,
"completion": 0,
"services": 0,
"subAgents": 0,
"total": 0,
"currency": "string"
},
"canceledByClient": true,
"citations": [
{
"citationIndex": 0,
"startIndex": 0,
"endIndex": 0,
"relevance": 0,
"source": {},
"citedText": "string"
}
],
"type": "string",
"request": "string",
"response": "string",
"input": [
{
"key": "string"
}
],
"skills": [
{
"name": "string",
"tool": "string",
"input": [
{
"key": "string"
}
],
"output": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"success": true,
"error": "string",
"iteration": 0,
"durationMs": 0,
"startDate": "2024-07-29T15:51:28.071Z"
}
],
"knowledge": [
{
"fileId": "string",
"fileName": "string",
"content": "string",
"relevance": 0,
"pageFrom": 0,
"pageTo": 0,
"position": 0,
"totalTokenCount": 0
}
],
"costBreakdown": {
"instanceId": "string",
"agentId": "string",
"agentCode": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
},
"services": {
"transcription": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"embeddings": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
],
"images": [
{
"instanceId": "string",
"usage": {
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0
},
"cost": {
"prompt": 0,
"completion": 0,
"total": 0
}
}
]
},
"subAgents": [
{}
]
}
}
The user is unauthorized or the session expired
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
The user does not have permission
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
The entity was not found
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
Array [
]
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
errors
object
nullable
Map of keys (an invalid request field or the rule that failed) to messages. Only present when the error has specific detail to report. Values are strings, except on input_validation_error, where each value is an array of messages for that field.
property name*
object
nullable
oneOf
string
string
{
"code": "string",
"message": "string",
"documentationUrl": "string",
"errors": {}
}
There was an unexpected error
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}