---
title: "Estimate usage credit cost"
method: POST
path: "/api/v1/usage/estimate"
tags: ["Usage"]
---

# Estimate usage credit cost

`POST /api/v1/usage/estimate`

Estimates the credit cost of a usage report without recording it. Returns the estimated cost per credit currency, the current balance, and the balance after the estimated consumption.

## Headers

- `X-ACCOUNT-ID` string
- `X-ENVIRONMENT-ID` string

## Request body

- EstimateUsageCostRequestDto — Estimate the credit cost of a usage report before reporting it
  - `value` integer, required — The value to report for usage
  - `featureId` string, required — Feature id
  - `customerId` string, required — Customer id
  - `resourceId` string, nullable — Resource id
  - `updateBehavior` 'DELTA' | 'SET' — The method by which the usage value should be updated
  - `dimensions` object — Additional dimensions for the usage report

## Response `200`

The credit cost estimation, including per-currency costs, balances, and warnings.

- CreditCostEstimationResponseDto — Response object
  - `data` object, required — Estimated credit cost, current balance and balance after
    - `estimates` object[], required — Per-currency cost estimates
      - `currencyId` string, required — The credit currency identifier
      - `estimatedCost` number, required — The estimated credit cost of the reported event or usage
      - `currentBalance` number, required — The current credit balance, including not-yet-reconciled consumption
      - `balanceAfterEstimate` number, required — The credit balance after subtracting the estimated cost
      - `wouldOverdraft` boolean, required — Whether the estimated consumption would bring the balance below zero
      - `breakdown` object[], required — Estimated cost contribution per feature
        - `featureId` string, required — The feature whose meter contributed this cost
        - `cost` number, required — The estimated credit cost contributed by this feature
        - `warningCode` 'UNSUPPORTED_AGGREGATION', nullable, required — Warning explaining why this cost may be inaccurate, if any
    - `warnings` string[], required — Request-level warnings about the estimation context

## Other responses

- `400` — bad request.
- `401` — User is not authenticated.
- `403` — User is not allowed to access this resource.
- `404` — CreditCostEstimation not found.
- `429` — Too many requests.

---

[API](https://skmtc.net/stiggio/apis/stigg-api.md) · [All operations](https://skmtc.net/stiggio/apis/stigg-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stiggio/stigg-api/revisions/3e2c8cfcd035/schema)
