GET
/
api
/
v1
/
project
/
usage
Python
# To use the Python SDK, install the package:
# pip install memobase

from memobase import MemoBaseClient

memobase = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')

usage = memobase.get_daily_usage(days=7)
{
  "data": [
    {
      "date": "<string>",
      "total_insert": 0,
      "total_success_insert": 0,
      "total_input_token": 0,
      "total_output_token": 0
    }
  ],
  "errno": 0,
  "errmsg": ""
}
Get the daily usage statistics of a project over the last N days. This endpoint provides detailed usage metrics including:
  • Total blob insertions per day
  • Successful blob insertions per day
  • Input tokens consumed per day
  • Output tokens consumed per day
The data is returned as a time series for the specified number of days, allowing you to track usage patterns and project activity over time.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

last_days
integer
default:7

The number of days to get

Response

Successful Response

data
DailyUsage · object[] | null

Response containing the daily usage

errno
enum<integer>

Error code, 0 means success

Available options:
0,
400,
401,
403,
404,
405,
409,
422,
500,
501,
502,
503,
504,
520
errmsg
string
default:""

Error message, empty when success