> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get credit usage

> Break the credit spend of an account down by day, project and model, optionally for one project; returns the series with token counts per model.

`veryfront__get_credit_usage`

Requires account.billing.read.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Read-only.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `preset` | `string` | No | Provide the preset. Default: `"30d"`. Values: `"7d"`, `"30d"`, `"90d"`. |
| `timezone` | `string` | No | Provide the timezone. Default: `"UTC"`. |
| `project_reference` | `string` | No | Project ID or slug that narrows the read to one project of the account. A project of another account is not found. Minimum length: `1`. |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](https://veryfront.com/docs/cloud/getting-started/connect-mcp.md).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__get_credit_usage",
    "arguments": {}
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `summary` | `object` | Yes | Structured summary details associated with this tool result. |
| `timeframe` | `object` | Yes | Structured timeframe details associated with this tool result. |
| `series` | `object[]` | Yes | List of series associated with this tool result. |
| `projects` | `object[]` | Yes | List of projects associated with this tool result. |
| `models` | `object[]` | Yes | List of models associated with this tool result. |
| `serving` | `object[]` | No | |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "preset": {
      "type": "string",
      "enum": [
        "7d",
        "30d",
        "90d"
      ],
      "description": "Provide the preset.",
      "default": "30d"
    },
    "timezone": {
      "type": "string",
      "description": "Provide the timezone.",
      "default": "UTC"
    },
    "project_reference": {
      "type": "string",
      "minLength": 1,
      "description": "Project ID or slug that narrows the read to one project of the account. A project of another account is not found."
    }
  },
  "additionalProperties": false,
  "description": "Arguments for the get_credit_usage tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "summary": {
      "type": "object",
      "properties": {
        "credits_used": {
          "type": "number"
        },
        "requests": {
          "type": "number"
        },
        "input_tokens": {
          "type": "number"
        },
        "output_tokens": {
          "type": "number"
        },
        "cache_creation_input_tokens": {
          "type": "number"
        },
        "cache_read_input_tokens": {
          "type": "number"
        }
      },
      "required": [
        "credits_used",
        "requests",
        "input_tokens",
        "output_tokens",
        "cache_creation_input_tokens",
        "cache_read_input_tokens"
      ],
      "additionalProperties": false,
      "description": "Structured summary details associated with this tool result."
    },
    "timeframe": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "granularity": {
          "type": "string",
          "const": "day"
        },
        "timezone": {
          "type": "string"
        },
        "bucket_count": {
          "type": "number"
        }
      },
      "required": [
        "from",
        "to",
        "granularity",
        "timezone",
        "bucket_count"
      ],
      "additionalProperties": false,
      "description": "Structured timeframe details associated with this tool result."
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "bucket_start": {
            "type": "string"
          },
          "credits_used": {
            "type": "number"
          },
          "requests": {
            "type": "number"
          },
          "input_tokens": {
            "type": "number"
          },
          "output_tokens": {
            "type": "number"
          },
          "cache_creation_input_tokens": {
            "type": "number"
          },
          "cache_read_input_tokens": {
            "type": "number"
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "project_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid",
                      "description": "Project identifier associated with this result."
                    },
                    {
                      "type": "null",
                      "description": "Project identifier associated with this result."
                    }
                  ],
                  "description": "Project identifier associated with this result."
                },
                "project_name": {
                  "type": "string"
                },
                "project_slug": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "credits_used": {
                  "type": "number"
                },
                "requests": {
                  "type": "number"
                },
                "input_tokens": {
                  "type": "number"
                },
                "output_tokens": {
                  "type": "number"
                },
                "cache_creation_input_tokens": {
                  "type": "number"
                },
                "cache_read_input_tokens": {
                  "type": "number"
                }
              },
              "required": [
                "project_id",
                "project_name",
                "project_slug",
                "credits_used",
                "requests",
                "input_tokens",
                "output_tokens",
                "cache_creation_input_tokens",
                "cache_read_input_tokens"
              ],
              "additionalProperties": false
            },
            "description": "List of projects associated with this tool result."
          }
        },
        "required": [
          "bucket_start",
          "credits_used",
          "requests",
          "input_tokens",
          "output_tokens",
          "cache_creation_input_tokens",
          "cache_read_input_tokens",
          "projects"
        ],
        "additionalProperties": false
      },
      "description": "List of series associated with this tool result."
    },
    "projects": {
      "type": "array",
      "items": {
        "$ref": "#/properties/series/items/properties/projects/items",
        "description": "One project item returned by the tool."
      },
      "description": "List of projects associated with this tool result."
    },
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "AI model id associated with this tool result."
          },
          "canonical_model_id": {
            "type": "string"
          },
          "model_provider": {
            "type": "string"
          },
          "inference_provider": {
            "type": "string"
          },
          "credits_used": {
            "type": "number"
          },
          "requests": {
            "type": "number"
          },
          "input_tokens": {
            "type": "number"
          },
          "output_tokens": {
            "type": "number"
          },
          "cache_creation_input_tokens": {
            "type": "number"
          },
          "cache_read_input_tokens": {
            "type": "number"
          },
          "provider_cost_usd": {
            "type": "number"
          },
          "veryfront_charge_usd": {
            "type": "number"
          },
          "cost_attribution": {
            "type": "string",
            "enum": [
              "estimated"
            ]
          }
        },
        "required": [
          "model",
          "model_provider",
          "inference_provider",
          "credits_used",
          "requests",
          "input_tokens",
          "output_tokens",
          "cache_creation_input_tokens",
          "cache_read_input_tokens"
        ],
        "additionalProperties": false
      },
      "description": "List of models associated with this tool result."
    },
    "serving": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "host": {
            "type": [
              "string",
              "null"
            ]
          },
          "tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "credits": {
            "type": "number"
          },
          "usd": {
            "type": "number"
          },
          "requests": {
            "type": "number"
          },
          "input_tokens": {
            "type": "number"
          },
          "output_tokens": {
            "type": "number"
          },
          "cache_read_tokens": {
            "type": "number"
          },
          "cache_creation_tokens": {
            "type": "number"
          }
        },
        "required": [
          "host",
          "tier",
          "credits",
          "usd",
          "requests",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_creation_tokens"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "summary",
    "timeframe",
    "series",
    "projects",
    "models"
  ],
  "additionalProperties": false,
  "description": "Structured result returned by the get_credit_usage tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

<details>
  <summary>Try this tool</summary>

  Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.

  MCP tool call

  Call `veryfront__get_credit_usage` against the Veryfront MCP endpoint.

  Bearer token or API key

  Arguments (JSON)

  Run tool

  Output JSON

  <pre />
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.