Ingest a batch of AI call observability events (agent internal)
Receives batched AICallEvent records from the agent’s observability worker and bulk-inserts them into MongoDB. Protected by the shared x-ai-tool-secret header — no JWT required.
POST
/
observability
/
ai-calls
Ingest a batch of AI call observability events (agent internal)
curl --request POST \
--url http://localhost:3002/api/v1/observability/ai-calls \
--header 'Content-Type: application/json' \
--header 'x-ai-tool-secret: <x-ai-tool-secret>' \
--data '
{
"events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"provider": "bedrock",
"modelId": "<string>",
"latencyMs": 123,
"success": true,
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"estimatedCostUsd": 123,
"error": "<string>",
"organizationId": "<string>",
"conversationId": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-ai-tool-secret': '<x-ai-tool-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
timestamp: '2023-11-07T05:31:56Z',
provider: 'bedrock',
modelId: '<string>',
latencyMs: 123,
success: true,
inputTokens: 123,
outputTokens: 123,
totalTokens: 123,
estimatedCostUsd: 123,
error: '<string>',
organizationId: '<string>',
conversationId: '<string>'
}
]
})
};
fetch('http://localhost:3002/api/v1/observability/ai-calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3002/api/v1/observability/ai-calls"
payload = { "events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"provider": "bedrock",
"modelId": "<string>",
"latencyMs": 123,
"success": True,
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"estimatedCostUsd": 123,
"error": "<string>",
"organizationId": "<string>",
"conversationId": "<string>"
}
] }
headers = {
"x-ai-tool-secret": "<x-ai-tool-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Last modified on July 17, 2026
Get current billing-period usage
Previous
Get aggregated AI call metrics for the authenticated organization
Next
⌘I
Ingest a batch of AI call observability events (agent internal)
curl --request POST \
--url http://localhost:3002/api/v1/observability/ai-calls \
--header 'Content-Type: application/json' \
--header 'x-ai-tool-secret: <x-ai-tool-secret>' \
--data '
{
"events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"provider": "bedrock",
"modelId": "<string>",
"latencyMs": 123,
"success": true,
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"estimatedCostUsd": 123,
"error": "<string>",
"organizationId": "<string>",
"conversationId": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-ai-tool-secret': '<x-ai-tool-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
timestamp: '2023-11-07T05:31:56Z',
provider: 'bedrock',
modelId: '<string>',
latencyMs: 123,
success: true,
inputTokens: 123,
outputTokens: 123,
totalTokens: 123,
estimatedCostUsd: 123,
error: '<string>',
organizationId: '<string>',
conversationId: '<string>'
}
]
})
};
fetch('http://localhost:3002/api/v1/observability/ai-calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3002/api/v1/observability/ai-calls"
payload = { "events": [
{
"timestamp": "2023-11-07T05:31:56Z",
"provider": "bedrock",
"modelId": "<string>",
"latencyMs": 123,
"success": True,
"inputTokens": 123,
"outputTokens": 123,
"totalTokens": 123,
"estimatedCostUsd": 123,
"error": "<string>",
"organizationId": "<string>",
"conversationId": "<string>"
}
] }
headers = {
"x-ai-tool-secret": "<x-ai-tool-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
.png?fit=max&auto=format&n=2PCWzKfmo53nDkKR&q=85&s=9f6b13dc0c2829ec8db5437603939f93)