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

# Account, credits, and billing

> Inspect the authenticated account, credit balance, pricing, checkout, and billing portal URLs

Use these endpoints when an integration needs to identify the active API key,
check whether enough credits are available, show current pricing, or send a user
to Stripe checkout or the billing portal.

## Endpoints

| Method | Path                | Purpose                                            |
| ------ | ------------------- | -------------------------------------------------- |
| `GET`  | `/me`               | Fetch the account identity for the active API key. |
| `GET`  | `/credits`          | Fetch available balance and credit package data.   |
| `GET`  | `/billing/catalog`  | Fetch subscription and top-up pricing.             |
| `POST` | `/billing/checkout` | Create a Stripe checkout URL.                      |
| `GET`  | `/billing/manage`   | Create a billing portal URL.                       |

Full request and response schemas are in **API reference**.

## Account identity

```bash theme={null}
curl https://api.youka.io/api/v1/me \
  -H "Authorization: Bearer yk_..."
```

The response includes `email`, `userId`, and `apiKeyId`. Use it at startup to
verify that an automation is running under the intended account.

## Credits

```bash theme={null}
curl https://api.youka.io/api/v1/credits \
  -H "Authorization: Bearer yk_..."
```

The response includes `availableBalance`, upcoming renewal dates, top-up credit
packages, and subscription renewal metadata.

## Billing catalog

```bash theme={null}
curl https://api.youka.io/api/v1/billing/catalog \
  -H "Authorization: Bearer yk_..."
```

Use the catalog response to display current unit credits, allowed quantities,
subscription pricing, top-up eligibility, and active subscription state.

## Checkout

```bash theme={null}
curl -X POST https://api.youka.io/api/v1/billing/checkout \
  -H "Authorization: Bearer yk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "productType": "subscription",
    "cycle": "monthly",
    "quantity": 1,
    "platform": "api"
  }'
```

For top-ups, pass `"productType": "topup"` and a positive `quantity`.
Subscriptions also require `cycle` as `monthly` or `yearly`.

## Billing portal

```bash theme={null}
curl "https://api.youka.io/api/v1/billing/manage?platform=api" \
  -H "Authorization: Bearer yk_..."
```

The returned URL is short-lived and should be opened by the account owner.

## What's next

* [Projects](/en/api/projects) - quote credits before creating a project
* [Exports](/en/api/exports) - quote credits before rendering
* [Errors](/en/api/errors) - handle authentication and billing errors
