Skip to content
Neutree Documentation

Viewing model usage

Model usage helps you analyze call trends by API key, model, and type, and view prompt, completion, and total token usage. Model usage statistics are stored in the PostgreSQL database of the Neutree control plane. The AI gateway extracts usage information from model call responses and continuously aggregates and displays it as daily usage statistics visible to users. Aggregated usage statistics are continuously retained in the PostgreSQL database until the related API key is deleted or database data is cleaned up.

Raw usage records written by the AI gateway are periodically aggregated into daily usage data and displayed on the page.

By default, you can view model usage generated by API keys that you created. To view aggregated usage for all API keys in a workspace, make sure that you have the Workspace:Usage Read permission. When All workspaces is selected, the page aggregates visible usage data of the current user across accessible workspaces.

Procedure

  1. Log in to the Neutree management interface. In the left navigation pane, click Model Usage.

  2. Select a time range. The page displays data from the last 30 days by default. You can also switch to Last 7 days or Last 90 days.

  3. Set filter conditions as needed.

    • API key: Select All API keys or a specific API key. After you select a single API key, the trend chart displays usage by model.
    • Type: Select All types, Internal, or External.
    • Model: Enter a model name to filter usage data by model name.
  4. View the trend chart.

    • If no API key is specified, the trend chart displays daily token usage by API key.
    • After an API key is specified, the trend chart displays daily token usage by model and automatically switches to Bar chart.
    • You can switch between Line chart and Bar chart.
    • Click a day in the trend chart to narrow Daily detail to that date. To cancel date filtering, click the close button of the date filter item.
  5. View summary information.

    The page provides two summary sections, By API key and By model, which display Prompt, Completion, and Total token usage within the current filter range.

  6. View Daily detail.

    Daily detail displays usage records in descending order by date, including Date, API key, Type, Endpoint, Model, Prompt, Completion, and Total.