# Move credits from the account into the avatar's sponsor pool

URL: https://www.atmee.ai/docs/v2/api/reference/avatars/grantAvatarSponsor

`POST /v1/avatars/{avatarId}/sponsor/grants`

Send an `Idempotency-Key` header to make retries safe: the same key replays the
first successful result instead of granting twice.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `avatarId` | path | yes |  |
| `Idempotency-Key` | header | no |  |

## Request body

- `application/json`: `SponsorGrantRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `microcredits` | integer | yes |  |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | Transferred (or replayed). | `SponsorGrantResponse` |
| `401` | Missing or invalid API key -- or a user token that is invalid, anonymous, or of a user who may act for no account (invalid_login) | none |
| `402` | insufficient_balance \| free_plan_credits_cannot_sponsor | `ApiErrorResponse` |
| `403` | insufficient_scope \| avatar_not_allowed | none |
| `404` | avatar_not_found | none |
| `409` | idempotency_key_reused -- the same Idempotency-Key was sent with a different avatar or amount | `ApiErrorResponse` |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `transferredMicrocredits` | integer | yes |  |
| `replayed` | boolean | yes | True when an earlier request with the same Idempotency-Key was replayed. |
| `error` | string | no | Only on `POST /v1/avatars`: the avatar was created but the manifest's funding was refused (e.g. `Insufficient balance`, `free_plan_credits_cannot_sponsor`). Fund it later via `/sponsor/grants`. Absent when the grant succeeded. |
