# Get usage
URL: https://docs.munito.ai/api/getUsage

GET /admin/v1/usage

Requests, tokens, pages, errors and cost of a time range, with averages per request.

The console's Analytics page shows the same data. Times are UTC. Usage counts are exact, and rated
costs come from the billing report, so the newest usage can wait for a cost.

Use an [admin key](https://docs.munito.ai/api/admin-authorization).

```json
{
  "tags": [
    "Administration"
  ],
  "summary": "Get usage",
  "description": "Requests, tokens, pages, errors and cost of a time range, with averages per request.\n\nThe console's Analytics page shows the same data. Times are UTC. Usage counts are exact, and rated\ncosts come from the billing report, so the newest usage can wait for a cost.\n\nUse an [admin key](https://docs.munito.ai/api/admin-authorization).",
  "operationId": "getUsage",
  "parameters": [
    {
      "name": "range",
      "in": "query",
      "required": false,
      "schema": {
        "enum": [
          "1h",
          "6h",
          "24h",
          "7d",
          "14d",
          "30d"
        ],
        "type": "string",
        "description": "A range that ends now. Ignored when month or start and end are set.",
        "default": "7d"
      },
      "description": "A range that ends now. Ignored when month or start and end are set."
    },
    {
      "name": "month",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          {
            "type": "null"
          }
        ],
        "description": "A UTC calendar month, such as 2026-09."
      },
      "description": "A UTC calendar month, such as 2026-09."
    },
    {
      "name": "start",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ],
        "description": "With end: a custom range of at most 30 days, in whole minutes."
      },
      "description": "With end: a custom range of at most 30 days, in whole minutes."
    },
    {
      "name": "end",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ],
        "description": "The end of a custom range."
      },
      "description": "The end of a custom range."
    },
    {
      "name": "group_by",
      "in": "query",
      "required": false,
      "schema": {
        "enum": [
          "model",
          "key"
        ],
        "type": "string",
        "description": "Break down by model or API key.",
        "default": "model"
      },
      "description": "Break down by model or API key."
    },
    {
      "name": "models",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          {
            "type": "null"
          }
        ],
        "description": "Only these model ids."
      },
      "description": "Only these model ids."
    },
    {
      "name": "keys",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          {
            "type": "null"
          }
        ],
        "description": "Only these API key ids."
      },
      "description": "Only these API key ids."
    },
    {
      "name": "include_series",
      "in": "query",
      "required": false,
      "schema": {
        "type": "boolean",
        "description": "Also return the totals of each interval.",
        "default": false
      },
      "description": "Also return the totals of each interval."
    }
  ],
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/UsageReport"
          }
        }
      }
    },
    "401": {
      "description": "The API key is missing or not valid.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      }
    },
    "403": {
      "description": "The API key does not hold admin:read, or the account is not active.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      }
    },
    "422": {
      "description": "A parameter is not valid.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      }
    },
    "429": {
      "description": "Too many requests with this API key. Retry in one minute.",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      }
    }
  }
}
```

# Shared API schemas
{
  "securitySchemes": {
    "BearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Your Munito API key, with the admin:read permission."
    },
    "ApiKeyAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key",
      "description": "Your Munito API key, with the admin:read permission."
    }
  },
  "schemas": {
    "ApiKey": {
      "properties": {
        "object": {
          "type": "string",
          "const": "api_key",
          "default": "api_key"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "prefix": {
          "type": "string",
          "description": "The start of the secret, to recognize the key."
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "revoked"
          ]
        },
        "permissions": {
          "items": {
            "type": "string",
            "enum": [
              "inference",
              "admin:read"
            ]
          },
          "type": "array",
          "description": "What the key may do: inference, admin:read."
        },
        "created_by_app": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The AI app that created the key through the MCP server. null for a key created in the console."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "prefix",
        "status",
        "permissions",
        "created_by_app",
        "created_at",
        "last_used_at"
      ]
    },
    "ApiKeyList": {
      "properties": {
        "object": {
          "type": "string",
          "const": "list",
          "default": "list"
        },
        "data": {
          "items": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "data"
      ]
    },
    "Model": {
      "properties": {
        "object": {
          "type": "string",
          "const": "model",
          "default": "model"
        },
        "id": {
          "type": "string",
          "description": "The id to send as model."
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "chat, ocr or another modality."
        },
        "context_length": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The tokens of one request, prompt and output. For an OCR model, the tokens of one page. Null for munito/ocr-auto and munito/ocr-fast, which read a document page by page."
        },
        "max_output_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The output tokens of one request. Null for munito/ocr-auto and munito/ocr-fast."
        },
        "input_modalities": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "kind",
        "context_length",
        "max_output_tokens",
        "input_modalities"
      ]
    },
    "ModelList": {
      "properties": {
        "object": {
          "type": "string",
          "const": "list",
          "default": "list"
        },
        "data": {
          "items": {
            "$ref": "#/components/schemas/Model"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "data"
      ]
    },
    "Organization": {
      "properties": {
        "object": {
          "type": "string",
          "const": "organization",
          "default": "organization"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "pending"
          ],
          "description": "pending: inference starts after verification."
        },
        "usage_tier": {
          "type": "string",
          "description": "Selects the default rate and spend limits."
        },
        "data_region": {
          "type": "string",
          "description": "Where the organization's files are stored: eu or us."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "status",
        "usage_tier",
        "data_region",
        "created_at"
      ]
    },
    "Responses": {
      "properties": {
        "success": {
          "type": "integer",
          "description": "2xx responses."
        },
        "client_errors": {
          "type": "integer",
          "description": "4xx responses other than 429."
        },
        "rate_limited": {
          "type": "integer",
          "description": "429 responses."
        },
        "server_errors": {
          "type": "integer",
          "description": "5xx responses other than 503."
        },
        "unavailable": {
          "type": "integer",
          "description": "503 responses."
        }
      },
      "type": "object",
      "required": [
        "success",
        "client_errors",
        "rate_limited",
        "server_errors",
        "unavailable"
      ]
    },
    "SpendLimit": {
      "properties": {
        "period": {
          "type": "string",
          "enum": [
            "day",
            "month"
          ],
          "description": "The UTC day or the UTC calendar month."
        },
        "spent_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "limit_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "The limit in force. null means no limit."
        },
        "organization_limit_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "The cap that the organization set, if any."
        },
        "account_limit_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "The highest cap that the account allows."
        },
        "stopped_until": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "Requests are refused until this time."
        }
      },
      "type": "object",
      "required": [
        "period",
        "spent_usd",
        "limit_usd",
        "organization_limit_usd",
        "account_limit_usd",
        "stopped_until"
      ]
    },
    "SpendLimits": {
      "properties": {
        "object": {
          "type": "string",
          "const": "spend_limits",
          "default": "spend_limits"
        },
        "usage_tier": {
          "type": "string"
        },
        "periods": {
          "items": {
            "$ref": "#/components/schemas/SpendLimit"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "usage_tier",
        "periods"
      ]
    },
    "Usage": {
      "properties": {
        "requests": {
          "type": "integer",
          "description": "HTTP responses of the inference API, every status."
        },
        "completed_requests": {
          "type": "integer",
          "description": "Requests that ran and counted tokens or pages."
        },
        "success_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Share of 2xx responses, 0 to 1."
        },
        "responses": {
          "$ref": "#/components/schemas/Responses"
        },
        "input_tokens": {
          "type": "integer"
        },
        "cached_input_tokens": {
          "type": "integer"
        },
        "cache_hit_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Cached share of input tokens, 0 to 1."
        },
        "output_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "rated_cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "null until the billing report rates the whole range."
        },
        "avg_input_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "avg_output_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "avg_total_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "requests",
        "completed_requests",
        "success_rate",
        "responses",
        "input_tokens",
        "cached_input_tokens",
        "cache_hit_rate",
        "output_tokens",
        "total_tokens",
        "pages",
        "rated_cost_usd",
        "avg_input_tokens_per_request",
        "avg_output_tokens_per_request",
        "avg_total_tokens_per_request"
      ]
    },
    "UsageGroup": {
      "properties": {
        "requests": {
          "type": "integer",
          "description": "HTTP responses of the inference API, every status."
        },
        "completed_requests": {
          "type": "integer",
          "description": "Requests that ran and counted tokens or pages."
        },
        "success_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Share of 2xx responses, 0 to 1."
        },
        "responses": {
          "$ref": "#/components/schemas/Responses"
        },
        "input_tokens": {
          "type": "integer"
        },
        "cached_input_tokens": {
          "type": "integer"
        },
        "cache_hit_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Cached share of input tokens, 0 to 1."
        },
        "output_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "rated_cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "null until the billing report rates the whole range."
        },
        "avg_input_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "avg_output_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "avg_total_tokens_per_request": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "type": "string",
          "description": "The model id, or the id of an API key. playground is the console."
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "requests",
        "completed_requests",
        "success_rate",
        "responses",
        "input_tokens",
        "cached_input_tokens",
        "cache_hit_rate",
        "output_tokens",
        "total_tokens",
        "pages",
        "rated_cost_usd",
        "avg_input_tokens_per_request",
        "avg_output_tokens_per_request",
        "avg_total_tokens_per_request",
        "id",
        "name"
      ]
    },
    "UsagePoint": {
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "requests": {
          "type": "integer"
        },
        "completed_requests": {
          "type": "integer"
        },
        "input_tokens": {
          "type": "integer"
        },
        "output_tokens": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "rated_cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "start",
        "requests",
        "completed_requests",
        "input_tokens",
        "output_tokens",
        "pages",
        "rated_cost_usd"
      ]
    },
    "UsageReport": {
      "properties": {
        "object": {
          "type": "string",
          "const": "usage_report",
          "default": "usage_report"
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "interval_seconds": {
          "type": "integer"
        },
        "group_by": {
          "type": "string",
          "enum": [
            "model",
            "key"
          ]
        },
        "costs_rated_until": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "Rated costs cover usage until this time."
        },
        "totals": {
          "$ref": "#/components/schemas/Usage"
        },
        "groups": {
          "items": {
            "$ref": "#/components/schemas/UsageGroup"
          },
          "type": "array",
          "description": "The groups with use, the most expensive first."
        },
        "series": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/components/schemas/UsagePoint"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Each interval of the range, when include_series is true."
        }
      },
      "type": "object",
      "required": [
        "start",
        "end",
        "interval_seconds",
        "group_by",
        "costs_rated_until",
        "totals",
        "groups",
        "series"
      ]
    },
    "User": {
      "properties": {
        "object": {
          "type": "string",
          "const": "user",
          "default": "user"
        },
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "member"
          ]
        },
        "added_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "When the person joined the organization."
        }
      },
      "type": "object",
      "required": [
        "id",
        "email",
        "role",
        "added_at"
      ]
    },
    "UserList": {
      "properties": {
        "object": {
          "type": "string",
          "const": "list",
          "default": "list"
        },
        "data": {
          "items": {
            "$ref": "#/components/schemas/User"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "data"
      ]
    },
    "Problem": {
      "type": "object",
      "description": "An RFC 9457 problem.",
      "properties": {
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer"
        },
        "detail": {
          "type": "string"
        }
      }
    }
  }
}