Credits
How API credit reservation, consumption, and refunds work for content generation.
The Qamera AI API uses a credit-based system to meter content generation. Understanding how credits flow through the API helps you manage costs and handle edge cases.
Free vs. Paid Endpoints
| Method | Credits | Examples |
|---|---|---|
| GET | Free | List products, retrieve order status, fetch job results. |
| POST | Consumes credits | Create packshot orders, trigger photo shoots, generate videos. |
Read operations never consume credits. Only POST requests that trigger content generation deduct from your account balance.
Credit Reservation Flow
When you submit a POST request that generates content, credits move through three stages:
1. Reservation
Before any processing begins, the API reserves the required number of credits from your account balance. This ensures your account can cover the cost of the requested generation.
If your balance is insufficient, the request is rejected immediately with a 402 Payment Required response:
{
"error": "Insufficient credits. Required: 5, available: 2."
}
2. Processing
The generation job runs. Your credits remain in a reserved state during this time — they are deducted from your available balance but not yet permanently consumed.
3. Settlement
Once processing completes:
- On success — Reserved credits are permanently consumed.
- On failure — Reserved credits are refunded to your account balance automatically.
You do not need to take any action for refunds. The system handles this automatically.
Tracking Credit Usage
POST responses that trigger generation include credit-related fields:
{
"orderId": "order_abc123",
"reservationId": "res_xyz789",
"creditsReserved": 5,
"status": "processing"
}
| Field | Description |
|---|---|
orderId | Unique identifier for the content generation order. |
reservationId | Identifier for the credit reservation tied to this order. |
creditsReserved | Number of credits reserved for this request. |
Use the orderId to poll the order status endpoint and confirm whether credits were consumed or refunded.
Checking Your Balance
Before submitting generation requests, verify that your account has sufficient credits. You can check your current credit balance in the Credits section of your team workspace, or factor the expected cost into your integration logic.
Pricing
The number of credits consumed per request depends on the content type and your account's pricing configuration. Different generation types (packshots, photo shoots, videos) have different credit costs. Refer to your subscription plan details for specific pricing.
Best Practices
- Check before you generate — If your workflow involves batch generation, verify your credit balance can cover the full batch before starting.
- Handle 402 gracefully — Build your integration to detect insufficient credit responses and alert your team before they block a workflow.
- Monitor reservations — Use
orderIdandreservationIdto track in-flight generation and reconcile credit usage. - Trust automatic refunds — Failed jobs refund credits without any intervention. There is no need to build manual refund logic.