---
title: "Credits"
description: "Grant a balance customers can spend in your app."
search:
  tags: ["Features"]
  keywords: ["credit balance", "usage packs", "operationId"]
---

Credits give customers one balance to spend across your app. You can charge five credits to generate an image and two to export a project, while letting the customer buy a single pack for both.

Your Products grant the credits. Your integration decides what each action costs and tells Nuxie how many to deduct.

## Create a credit system

1. **Name the balance**

    Open **Credits** and choose **Create Credit System**. Enter a **Credit system name**.

2. **Choose its key**

    Check the suggested **Credit key**, such as `creative-credits`. Nuxie suggests a key from the name; it can contain letters, numbers, and dashes.

3. **Save the credit system**

    Choose **Create Credit System** to save it.

Use the credit key whenever you check or spend this balance. For example:

| Action | Key | Quantity |
| --- | --- | --- |
| Generate an image | `creative-credits` | 5 |
| Export a project | `creative-credits` | 2 |

Your app supplies the cost. Nuxie doesn't infer it from the action or automatically spend credits when a separate metered Feature runs out.

## Grant credits

Open a Product's **Entitlements** tab, choose **Grant Feature**, and select the credit system. Choose **Fixed units** and enter a positive whole number, or choose **Unlimited** for usage without a balance cap. Choose **Grant Feature** to save.

A pack of 100 creative credits can pay for either action in the example. If a customer has several active fixed grants, they contribute to the balance. An active unlimited grant lets the customer use the Feature without a balance cap.

The credit system's **Products** tab shows which Products include it. **Overview** shows its platform availability, while the details sidebar includes the key and environment.

<span id="apply-credits-to-usage" />

## Consume credits

Show the available balance in your interface, then submit the credit key and cost when the customer starts a paid action. Wait for an accepted result before performing the work. Checking the balance earlier doesn't reserve credits.

With 100 credits, a successful image generation request consumes five and leaves 95. An export then consumes two and leaves 93. Both requests use `creative-credits`; their quantities supply the different prices.

On iOS, check `success` on the result of [`useFeatureAndWait()`](/docs/ios-sdk/features-and-entitlements#consume-usage) before doing the work. Other platforms expose the decision through their [Feature consumption API](/docs/reference).

Purchased credits need server confirmation before they can be spent. After an App Store purchase, the SDK can send the matching purchase with the first usage request, letting Nuxie grant the credits and deduct the cost together.

## Retries and remaining balance

Keep an operation ID with any action you might retry. Send the same request and ID again to receive its saved result without another deduction.

Use the SDK's consumption method that accepts an operation ID for this path. On iOS, that's [`consumeFeature()`](/docs/ios-sdk/features-and-entitlements#retry-an-operation); `useFeatureAndWait()` doesn't take an app-supplied ID.

An accepted action can leave the customer with zero credits. Let that action finish, then show the new balance for whatever they do next. A rejected request doesn't allow the work to proceed.

[Metered usage](/docs/monetization/metered-usage) explains retries and cumulative totals. The [iOS access guide](/docs/ios-sdk/features-and-entitlements) includes the SDK calls.

## Delete a credit system

Choose **Delete** in the Credits table. Nuxie blocks deletion while an active Product Grant uses the system, so remove those grants first.
