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

# Get Project Daily Usage

> Get the usage of a project in the last days

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.


## OpenAPI

````yaml get /api/v1/project/usage
openapi: 3.1.0
info:
  title: Memobase API
  summary: APIs for Memobase, a user memory system for LLM Apps
  version: 0.0.40
servers:
  - url: https://api.memobase.dev
  - url: https://api.memobase.cn
security:
  - BearerAuth: []
paths:
  /api/v1/project/usage:
    get:
      tags:
        - project
      summary: Get Project Usage
      description: Get the usage of a project in the last days
      operationId: get_project_usage_api_v1_project_usage_get
      parameters:
        - name: last_days
          in: query
          required: false
          schema:
            type: integer
            description: The number of days to get
            default: 7
            title: Last Days
          description: The number of days to get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-code-samples:
        - lang: python
          source: >+
            # 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)

          label: Python
        - lang: go
          source: >+
            // To use the Go SDK, install the package:

            // go get
            github.com/memodb-io/memobase/src/client/memobase-go@latest


            import (
                "fmt"
                "log"

                "github.com/memodb-io/memobase/src/client/memobase-go/core"
            )


            func main() {
                projectURL := "YOUR_PROJECT_URL"
                apiKey := "YOUR_API_KEY"
                // Initialize the client
                client, err := core.NewMemoBaseClient(
                    projectURL,
                    apiKey,
                )
                if err != nil {
                    log.Fatalf("Failed to create client: %v", err)
                }

                // Get daily usage
                usage, err := client.GetDailyUsage(7)
                if err != nil {
                    log.Fatalf("Failed to get daily usage: %v", err)
                }
                fmt.Printf("Usage: %v
            ", usage)

            }

          label: Go
components:
  schemas:
    UsageResponse:
      properties:
        data:
          anyOf:
            - items:
                $ref: '#/components/schemas/DailyUsage'
              type: array
            - type: 'null'
          title: Data
          description: Response containing the daily usage
        errno:
          $ref: '#/components/schemas/CODE'
          description: Error code, 0 means success
          default: 0
        errmsg:
          type: string
          title: Errmsg
          description: Error message, empty when success
          default: ''
      type: object
      title: UsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DailyUsage:
      properties:
        date:
          type: string
          title: Date
          description: The date
        total_insert:
          type: integer
          title: Total Insert
          description: The total insert
          default: 0
        total_success_insert:
          type: integer
          title: Total Success Insert
          description: The total update
          default: 0
        total_input_token:
          type: integer
          title: Total Input Token
          description: The total input token
          default: 0
        total_output_token:
          type: integer
          title: Total Output Token
          description: The total output token
          default: 0
      type: object
      required:
        - date
      title: DailyUsage
    CODE:
      type: integer
      enum:
        - 0
        - 400
        - 401
        - 403
        - 404
        - 405
        - 409
        - 422
        - 500
        - 501
        - 502
        - 503
        - 504
        - 520
      title: CODE
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````