get_credit_transactions
Get recent AI credit movements for the account this token belongs to, newest first.
Read account
Returns data. Calling it changes nothing, so it is safe in an unattended loop.
What it does
Get recent AI credit movements for the account this token belongs to, newest first.
USAGE INSTRUCTIONS FOR LLM:
Use this to explain WHERE credit went, or to show that a purchase was recorded.
Each row is one movement: a negative `amountUsd` is a charge, a positive one is
a top-up or an adjustment. `source` says what kind of usage it was (for example
`direct_mcp` for tool calls made from an external client like this one,
`image_generation`, `opik_ai_chat`, `maxio_topup` for a purchase).
WHEN TO USE THIS TOOL:
- User asks "what have I been charged for?" or "where did my credits go?"
- User disputes a charge and wants the detail behind it
- After a payment, to show the customer the top-up on their history
- To find the `referenceId` of a purchase so you can pass it to
`get_payment_status`
EXPECTED RESPONSE FORMAT:
{
"account_id": "1234",
"transactions": [
{"amountUsd": -0.04, "source": "direct_mcp", "description": "MCP tool: ...",
"referenceId": "...", "createdAt": "...", "markup": "4.000000"}
],
"total_elements": 210, "total_pages": 9, "page": 0
}Arguments
| Argument | Type | Notes | |
|---|---|---|---|
page |
integer | Zero-based page number. Defaults to 0 (most recent). | |
size |
integer | Rows per page, 1-100. Defaults to 25. |
Request
curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
-H "Authorization: $METADATA_PAT" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_credit_transactions","arguments":{}}}'
Response
Real, from the production server, in 219 ms. The full response was 22,164 bytes; this is the first part of it. Values that identify a customer or disclose money are replaced with typed placeholders; keys, types and nesting are exactly as returned.
recorded response
{
"account_id": "[account_id redacted]",
"transactions": [
{
"id": "[number redacted]",
"accountId": "[number redacted]",
"amountUsd": "[number redacted]",
"rawCostUsd": "[number redacted]",
"markup": "[number redacted]",
"source": "direct_mcp",
"description": "[description redacted]",
"conversationId": null,
"referenceId": "[referenceId redacted]",
"metadata": {
"client": "unknown",
"pricing": {
"band": "report",
"model": "report",
"base_usd": "[base_usd redacted]",
"time_usd": "[time_usd redacted]",
"volume_usd": "[volume_usd redacted]",
"duration_ms": "[number redacted]",
"response_chars": "[number redacted]"
},
"user_id": "[user_id redacted]",
"tool_name": "list_search_terms",
"tool_title": "[tool_title redacted]"
},
"occurredAt": "2026-09-05T14:49:30.926659",
"createdAt": "2026-09-05T14:49:30.945036",
"createdBy": "credit-event"
},
{
"id": "[number redacted]",
"accountId": "[number redacted]",
"amountUsd": "[number redacted]",
"rawCostUsd": "[number redacted]",
"markup": "[number redacted]",
"source": "direct_mcp",
"description": "[description redacted]",
"conversationId": null,
"referenceId": "[referenceId redacted]",
"metadata": {
"client": "unknown",
"pricing": {
"band": "report",
"model": "report",
"base_usd": "[base_usd redacted]",
"time_usd": "[time_usd redacted]",
"volume_usd": "[volume_usd redacted]",
"duration_ms": "[number redacted]",
"response_chars": "[number redacted]"
},
"user_id": "[user_id redacted]",
"tool_name": "[tool_name redacted]",
"tool_title": "[tool_title redacted]"
},
"occurredAt": "2026-09-05T14:49:29.066003",
"createdAt": "2026-09-05T14:49:29.08552",
"createdBy": "credit-event"
},
{
"id": "[number redacted]",
"accountId": "[number redacted]",
"amountUsd": "[number redacted]",
"rawCostUsd": "[number redacted]",
"markup": "[number redacted]",
"source": "direct_mcp",
"description": "[description redacted]",
"conversationId": null,
"referenceId": "[referenceId redacted]",
"metadata": {
"client": "unknown",
"pricing": {
"band": "report",
"model": "report",
"base_usd": "[base_usd redacted]",
"time_usd": "[time_usd redacted]",
"volume_usd": "[volume_usd redacted]",
"duration_ms": 78,
"response_chars": "[number redacted]"
},
"user_id": "[user_id redacted]",
"tool_name": "list_keywords",
"tool_title": "[tool_title redacted]"
},
"occurredAt": "2026-09-05T14:49:28.413843",
"createdAt": "2026-09-05T14:49:28.431393",
"createdBy": "credit-event"
},
{
"id": "[number redacted]",
"accountId": "[number redacted]",
"amountUsd": "[number redacted]",
"rawCostUsd": "[number redacted]",
"markup": "[number redacted]",
"source": "direct_mcp",
"description": "[description redacted]",
"conversationId": null,
"referenceId": "[referenceId redacted]",
"metadata": {
"client": "unknown",
"pricing": {
"band": "report",
"model": "report",
"base_usd": "[base_usd redacted]",
"time_usd": "[time_usd redacted]",
"volume_usd": "[volume_usd redacted]",
"duration_ms": "[number redacted]",
"response_chars": "[number redacted]"
},
"user_id": "[user_id redacted]",
"tool_name": "[tool_name redacted]",
"tool_title": "[tool_title redacted]"
},
"occurredAt": "2026-09-05T14:49:28.230306",
"createdAt": "2026-09-05T14:49:28.247667",
"createdBy": "credit-event"
},
{
"id": "[number redacted]",
"accountId": "[number redacted]",
"amountUsd": "[number redacted]",
"rawCostUsd": "[number redacted]",
"markup": "[number redacted]",
"source": "direct_mcp",
"description": "[description redacted]",
"conversationId": null,
"referenceId": "[referenceId redacted]",
"metadata": {
"client": "unknown"
… truncated
Related
Other account tools: