> ## Documentation Index
> Fetch the complete documentation index at: https://docs.makelocalads.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Credits and spending

> What each operation costs, how to check your balance, and how to cap what a request spends.

Only generation spends credits. Planning steps are free: creating products,
adding and editing audiences, suggesting angles, moodboards, video concepts,
listing ideas, and rewriting ChatGPT ad copy or targeting.

## What things cost

`GET /pricing` lists the credit cost of every paid operation:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://makelocalads.com/api/v1/pricing \
  --header "Authorization: Bearer $LOCALADS_API_KEY"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "unit": "credits",
  "operations": [
    { "operation": "campaign_creative", "endpoint": "POST /v1/campaigns", "credits": 2, "per": "creative" },
    { "operation": "campaign_creative", "endpoint": "POST /v1/campaigns/{campaign_id}/creatives", "credits": 2, "per": "creative" },
    { "operation": "photoshoot_image", "endpoint": "POST /v1/photoshoots", "credits": 1, "per": "image" },
    { "operation": "chatgpt_ad", "endpoint": "POST /v1/chatgpt-ad-groups", "credits": 1, "per": "ad" },
    { "operation": "chatgpt_ad", "endpoint": "POST /v1/chatgpt-ad-groups/{ad_group_id}/ads", "credits": 1, "per": "ad" },
    { "operation": "amazon_listing_image", "endpoint": "POST /v1/amazon-listing-images", "credits": 2, "per": "image" },
    { "operation": "amazon_listing_image", "endpoint": "POST /v1/amazon-listing-ideas/{idea_id}/image", "credits": 2, "per": "image" },
    { "operation": "ugc_video", "endpoint": "POST /v1/videos", "credits": 2, "per": "second" },
    { "operation": "video_animation", "endpoint": "POST /v1/videos", "credits": 2, "per": "second" }
  ]
}
```

## Check what you have

`GET /account` returns the credits available, the plan, and the calling key's
monthly budget. It is free:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://makelocalads.com/api/v1/account \
  --header "Authorization: Bearer $LOCALADS_API_KEY"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "organization": { "name": "Quenzy" },
  "plan": { "slug": "pro", "label": "Pro" },
  "credits": { "available": 240 },
  "limits": { "brands": null, "products": null },
  "api_key": {
    "id": "3f7a1c9e-5b2d-4e8f-9c1a-7d4e8f2a6b5c",
    "name": "Nightly sync",
    "monthly_credit_cap": 500,
    "credits_used_this_month": 42,
    "credits_remaining_this_month": 458
  }
}
```

## Cap a request with max\_credits

Every request that spends credits accepts an optional `max_credits`. If the
request would cost more, it returns `422` with the code
`credit_limit_exceeded`, and nothing is charged:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "type": "https://docs.makelocalads.com/errors/credit-limit-exceeded",
  "title": "Credit limit exceeded",
  "status": 422,
  "detail": "This request can spend up to 20 credits, but it would cost 40.",
  "code": "credit_limit_exceeded",
  "request_id": "83cff1a5-f3ea-42d4-8920-2b2b69ec31de"
}
```

If the account itself has fewer credits than the request needs, the response
is `422` with the code `insufficient_credits`, and nothing is charged.

## Monthly key budgets

A key can carry a monthly credit budget. When it is used up, requests that
start new generation return `422` with the code `key_budget_exceeded`; reads
keep working. See
[API keys and permissions](/concepts/keys-and-permissions).

## Failed renders

A failed render is refunded: a job's `credits_charged` counts only the work
that completed. Check `credits_charged` when a job finishes to see what was
actually spent.
