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

# API introduction

> One OpenAI-compatible endpoint today; a full management API is on the roadmap.

## Base URL

```
https://api.tokengift.ai/v1
```

## Authentication

Pass your app's API key as a Bearer token:

```
Authorization: Bearer tg_live_…
```

Keys are issued in the [dashboard](https://tokengift.ai/dashboard), shown once, stored
hashed. Rotate by issuing a new key and revoking the old one.

## Compatibility promise

`POST /v1/chat/completions` accepts the OpenAI Chat Completions request shape (a curated
subset — streaming and non-streaming) and proxies to our curated model list. If you use an
OpenAI SDK, you only change `baseURL` and `apiKey`.

## Response headers

| Header                   | Meaning                                                                         |
| ------------------------ | ------------------------------------------------------------------------------- |
| `TokenGift-Balance`      | Wallet balance (USD) after this request                                         |
| `TokenGift-Request-Cost` | Exact cost (USD) of this request                                                |
| `TokenGift-Request-Id`   | ID for support and debugging — on every response, including errors              |
| `TokenGift-Version`      | API version that served the request (date-based, e.g. `2026-07-29`)             |
| `x-ratelimit-*`          | OpenAI-compatible rate limit info — see [Errors](/reference/errors#rate-limits) |

## Versioning

The current API version is date-based and returned in the `TokenGift-Version` header.
There is only one version today; when a breaking change ships, you'll be able to pin a
version per request with a `TokenGift-Version` request header, and existing integrations
keep their behavior.

## Roadmap

A management API (balances, gift issuance, usage reports) with `Idempotency-Key` support
and cursor pagination is in active development — along with official TypeScript and
Python SDKs and an MCP server for AI agents.
