---
title: "Grant Ai Credit"
method: POST
path: "/api/billing/ai-balance/grant"
tags: ["billing"]
---

# Grant Ai Credit

`POST /api/billing/ai-balance/grant`

## Request

- Base URL: `https://softkiln.com` (the document declares no server; this is the origin it was published from)
- URL: `https://softkiln.com/api/billing/ai-balance/grant`
- Auth: none declared

Comp an organization AI credit. Platform admin only.

Not reachable by an org's own admins, and not exposed over MCP at all. Now
that customers can buy credit themselves, this is the *comp* path: credit
nobody paid for, which is why it stays deliberate and attributable rather
than merely privileged. Every call writes an `ai_credit_grants` row naming
the granting user.

`LogtoAdminUser` and not `AdminUser`: the in-app `admin` role can be set in
the database independently of the Logto scope, and minting money is not
something a row in a table should be able to authorize.

## Query parameters

- `org` string, required

## Request body

- GrantCreditRequest
  - `amount_usd` number, required
  - `reason` string

## Response `200`

Successful Response

- AiBalanceOut
  - `balance_microcents` integer, required
  - `reserved_microcents` integer, required
  - `available_microcents` integer, required
  - `auto_refill_enabled` boolean, required
  - `low_balance_threshold_microcents` integer, nullable, required
  - `auto_refill_amount_microcents` integer, nullable, required
  - `has_payment_method` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/softkiln/apis/app-manager-api.md) · [All operations](https://skmtc.dev/softkiln/apis/app-manager-api/llms.txt) · [OpenAPI document](https://skmtc.dev/softkiln/apis/app-manager-api/revisions/de2b674a7f21?raw)
