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

# Account & API Keys

> Manage your Forii account, API keys, and usage programmatically

Programmatic access to account management, API key lifecycle, and usage queries.

<Info>
  Forii is on the **Free Plan** today. The credit purchase, Razorpay checkout, auto-recharge, and invoice endpoints below are on the roadmap and not yet live. Only account, API key, balance, and usage endpoints are available today.
</Info>

## Account

### Get account

```bash theme={null}
GET /v1/accounts/{account_id}
```

Returns name, email, plan, and credit balance.

### Create API key

```bash theme={null}
POST /v1/accounts/{account_id}/apiKeys
Authorization: Bearer {session_token}
Content-Type: application/json

{"name": "prod-api"}
```

```json theme={null}
{
  "id": "key_abc123",
  "name": "prod-api",
  "key": "forii_sk_xxxxxxxxxxxxxxxxxxxxxxxx",
  "created": "2025-01-15T10:30:00Z",
  "status": "active"
}
```

<Warning>
  The full API key is returned only once at creation. Store it securely.
</Warning>

### List API keys

```bash theme={null}
GET /v1/accounts/{account_id}/apiKeys
Authorization: Bearer {session_token}
```

Returns masked keys with metadata.

### Delete API key

```bash theme={null}
DELETE /v1/accounts/{account_id}/apiKeys/{key_id}
Authorization: Bearer {session_token}
```

Immediate revocation. Any in-flight requests with this key will fail.

## Balance

### Get balance

```bash theme={null}
GET /v1/accounts/{account_id}/balance
Authorization: Bearer {session_token}
```

```json theme={null}
{
  "credits_inr": 50.00,
  "plan": "free"
}
```

<Info>
  Free Plan accounts start with ₹50 in credits. Paid tiers and credit purchases are coming soon.
</Info>

## Usage

```bash theme={null}
GET /v1/accounts/{account_id}/usage?start=2025-01-01&end=2025-01-31&group_by=model
Authorization: Bearer {session_token}
```

```json theme={null}
{
  "data": [
    {
      "date": "2025-01-15",
      "model": "forii/deepseek-v3",
      "prompt_tokens": 1250000,
      "completion_tokens": 340000,
      "total_tokens": 1590000,
      "cost_inr": 531.50
    }
  ]
}
```

<Info>
  All costs in INR. This is an India differentiator — no USD conversion needed.
</Info>

## Roadmap — Credits & Billing (not yet live)

The following endpoints ship when paid tiers launch. They are documented here for forward compatibility only.

| Endpoint                                      | Purpose                               | Status      |
| --------------------------------------------- | ------------------------------------- | ----------- |
| `POST /v1/accounts/{id}/credits`              | Initiate credit purchase via Razorpay | Coming soon |
| `POST /v1/accounts/{id}/credits/verify`       | Verify Razorpay payment, add credits  | Coming soon |
| `GET/PUT /v1/accounts/{id}/auto_recharge`     | Auto-recharge configuration           | Coming soon |
| `GET /v1/accounts/{id}/transactions`          | Transaction history                   | Coming soon |
| `GET /v1/accounts/{id}/invoices/{invoice_id}` | GST-compliant PDF invoice             | Coming soon |

When paid tiers ship, Forii will use [Razorpay](https://razorpay.com) for payment processing with UPI, cards, netbanking, and wallets.

## Related

* [Pricing](/docs/concepts/pricing) — Model pricing and the Free Plan
* [Dashboard](/docs/webapp/dashboard) — API keys, usage, and recent requests in the UI
