---
updatedAt: 2025-09-02T07:17:19.000Z
agentTools:
  projectIndex: https://jamaibase.readme.io/llms.txt
---

# Get storage usage metrics.

Permissions: `system.MEMBER`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JamAI Base API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "0.1.0",
    "x-logo": {
      "url": "https://www.jamaibase.com/favicon.svg"
    }
  },
  "servers": [
    {
      "url": "https://api.jamaibase.com"
    }
  ],
  "paths": {
    "/api/v2/meters/storages": {
      "get": {
        "tags": [
          "Meters (Internal API)"
        ],
        "summary": "Get storage usage metrics.",
        "description": "Permissions: `system.MEMBER`.",
        "operationId": "get_storage_metrics_api_v2_meters_storages_get",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start datetime for the storage data query.",
              "title": "From"
            },
            "description": "Start datetime for the storage data query."
          },
          {
            "name": "windowSize",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "The aggregation window size (e.g., '1d' for daily, '1w' for weekly).",
              "title": "Windowsize"
            },
            "description": "The aggregation window size (e.g., '1d' for daily, '1w' for weekly)."
          },
          {
            "name": "orgIds",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "List of organization IDs to filter the query. If not provided, data for all organizations is returned.",
              "title": "Orgids"
            },
            "description": "List of organization IDs to filter the query. If not provided, data for all organizations is returned."
          },
          {
            "name": "projIds",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "List of project IDs to filter the query. If not provided, data for all projects is returned.",
              "title": "Projids"
            },
            "description": "List of project IDs to filter the query. If not provided, data for all projects is returned."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "End datetime for the storage data query. If not provided, data up to the current datetime is returned."
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "minItems": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "List of fields to group the storage data by. If not provided, no grouping is applied.",
              "title": "Groupby"
            },
            "description": "List of fields to group the storage data by. If not provided, no grouping is applied."
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Service key.",
              "title": "Authorization"
            },
            "description": "Service key."
          },
          {
            "name": "X-USER-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "User ID.",
              "default": "",
              "title": "X-User-Id"
            },
            "description": "User ID."
          }
        ],
        "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"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "Usage": {
        "properties": {
          "value": {
            "type": "number",
            "title": "Value"
          },
          "window_start": {
            "type": "string",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "title": "Window End"
          },
          "subject": {
            "type": "string",
            "title": "Subject"
          },
          "groupBy": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Groupby"
          }
        },
        "type": "object",
        "required": [
          "value",
          "window_start",
          "window_end",
          "subject",
          "groupBy"
        ],
        "title": "Usage"
      },
      "UsageResponse": {
        "properties": {
          "windowSize": {
            "type": "string",
            "title": "Windowsize"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Usage"
            },
            "type": "array",
            "title": "Data"
          },
          "start": {
            "type": "string",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "title": "End"
          }
        },
        "type": "object",
        "required": [
          "windowSize",
          "data",
          "start",
          "end"
        ],
        "title": "UsageResponse"
      },
      "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": {
      "Authentication": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "Authentication": []
    }
  ]
}
```