Track and evaluate your AI agent calls with a single API call. Works with any language or framework.
Send a POST request to /api/ingest with your agent API token. That's it — works with any language or framework.
await fetch('https://www.agentplasticity.com/api/ingest', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
prompt: 'Summarize this document...',
output: 'The document discusses...',
modelName: 'gpt-4o',
}),
});With optional metadata (token usage, latency):
const start = Date.now();
const output = await llm.chat('Summarize this document...');
const latencyMs = Date.now() - start;
await fetch('https://www.agentplasticity.com/api/ingest', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.AGENT_PLASTICITY_API_KEY}`,
},
body: JSON.stringify({
prompt: 'Summarize this document...',
output,
modelName: 'gpt-4o',
systemPrompt: 'You are a helpful assistant.',
metadata: { latencyMs, tokenUsage: 350 },
}),
});import requests
requests.post(
"https://www.agentplasticity.com/api/ingest",
headers={"Authorization": "Bearer YOUR_API_TOKEN"},
json={
"prompt": "Summarize this document...",
"output": "The document discusses...",
"modelName": "gpt-4o",
"metadata": {"latencyMs": 1200, "tokenUsage": 350},
},
)curl -X POST https://www.agentplasticity.com/api/ingest \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"prompt": "Summarize this document...",
"output": "The document discusses...",
"modelName": "gpt-4o",
"metadata": {
"latencyMs": 1200,
"tokenUsage": 350
}
}'All requests go to POST /api/ingest with a Bearer token in the Authorization header.
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | The prompt sent to the AI model |
| output | string | Yes | The AI model's response |
| modelName | string | Yes | Model identifier (e.g. "gpt-4o") |
| systemPrompt | string | No | System prompt used for the call |
| metadata | object | No | Optional data: tokenUsage (number), latencyMs (number), or any custom fields |
The /api/ingest endpoint returns standard HTTP status codes:
| Status | Meaning | What to do |
|---|---|---|
| 201 | Created | Call tracked successfully |
| 400 | Bad Request | Check required fields: prompt, output, modelName |
| 401 | Unauthorized | Check your API token is valid and the agent is active |
| 429 | Rate Limited | Back off and retry. Check X-RateLimit-Reset header |
| 500 | Server Error | Retry with exponential backoff |