---
title: "Check if usage is allowed for a customer and product"
method: POST
path: "/usage/check-usage"
tags: ["usage"]
---

# Check if usage is allowed for a customer and product

`POST /usage/check-usage`

## Request

- Base URL: `https://api.agentpaid.io/api/v1`
- URL: `https://api.agentpaid.io/api/v1/usage/check-usage`
- Auth: HTTP bearer

## Request body

- object
  - `externalCustomerId` string, required: External customer ID
  - `externalProductId` string, required: External product ID (the external ID of the product/agent)

## Response `200`

Usage check response

- UsageCheckUsageResponse200
  - `allowed` boolean: Whether usage is allowed
  - `message` string: Human-readable message about the usage check result
  - `eventName` string: Event name (only present when usage is not allowed)
  - `available` number, double: Available credits (only present for PrepaidCredits when insufficient)
  - `eventsQuantity` number, double: Current events quantity (only present when usage exceeds limit)
  - `limit` number, double: Usage limit (only present when usage exceeds limit)

## Other responses

- `400`: Bad request - Invalid API key, missing authorization, or missing required fields (externalCustomerId, externalProductId)
- `404`: Not found - Order, plan, or product not found
- `500`: Internal server error

---

[API](https://skmtc.dev/paid/apis/paid-2.md) - [All operations](https://skmtc.dev/paid/apis/paid-2/llms.txt) - [OpenAPI document](https://skmtc.dev/paid/apis/paid-2/revisions/dbdf4a60ed27?raw)
