# Account APIs

> Account-level monitoring - track credit consumption, monthly allocation, and per-API usage breakdowns.

- **Auth:** `X-API-Key` + `X-API-Secret` headers
- **Mode:** Asynchronous - submit returns `202 Accepted` + `request_id`; poll the submit path or use a `callback_url` webhook.
- **HTML version:** https://api.nyne.ai/documentation/account

The Account APIs report on your own API account rather than on people or companies. They are synchronous reads - no queue, no `request_id` - and they never consume credits.

## Endpoints

### Monitoring

See what your account has consumed and what remains.

- **[Usage](https://api.nyne.ai/documentation/account/usage.md)** - `GET /usage` - Monitor credit consumption, allocation, and per-API breakdown (synchronous, 200).

## Worked example

The [Usage](https://api.nyne.ai/documentation/account/usage) endpoint returns the current month's credit and request statistics in a single synchronous call.

### 1. Submit - `GET /usage`

```bash
curl https://api.nyne.ai/usage \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
```

The call returns `202 Accepted` immediately:

```json
{
  "request_id": "a1b2c3d4e5f6_1717000000_4271",
  "status": "queued"
}
```

### 2. Poll until completed

```bash
curl "https://api.nyne.ai/usage?request_id=<request_id>" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
```

When `status` is `completed`, the same response carries the result:

```json
{
  "month": 12,
  "year": 2024,
  "period": "2024-12",
  "credits_used": {
    "total": 68,
    "search": 45,
    "enrichment": 23
  },
  "requests_count": {
    "total": 25,
    "search": 15,
    "enrichment": 10
  },
  "limits": {
    "monthly_allocation": 10000,
    "available_credits": 9932,
    "is_unlimited": false
  },
  "breakdown": {
    "search_results_returned": 45,
    "enrichments_performed": 23,
    "total_credits_consumed": 68
  }
}
```

## Authentication & credits

All `/person/*` and `/company/*` endpoints authenticate with an API key and secret sent as HTTP headers on every request: `X-API-Key` and `X-API-Secret`. Create keys from your Nyne dashboard and keep the secret server-side. Rate limits: 100 requests/minute, 1,000 requests/hour. Full guide: https://api.nyne.ai/documentation/authentication.md

Credits are charged only on meaningful results - empty results never burn credits. Each endpoint page lists its exact credit costs.

---

All documentation pages are available as Markdown by appending `.md` to their URL. Index: https://api.nyne.ai/llms.txt
