> ## 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.

# Quickstart

> User-funded AI in 5 minutes. No credit card required — every new app starts with $5.00 in starter credits.

## 1. Create your app

Sign up at [tokengift.ai](https://tokengift.ai/signup) and create an app from the dashboard. You get:

| What        | Example                    | Use it for                                     |
| ----------- | -------------------------- | ---------------------------------------------- |
| API key     | `tg_live_a1b2…`            | Server-side only. Shown once — save it         |
| Wallet      | \$5.00 starter credits     | Spent automatically as your app makes requests |
| Top-up page | `tokengift.ai/fuel/my-app` | Share it so users can fund your app            |

<Warning>API keys are shown once and stored hashed. Treat them like passwords — never ship them in client-side code.</Warning>

## 2. Make your first request

TokenGift is OpenAI-compatible. If your app already uses an OpenAI SDK, change two lines:

<CodeGroup>
  ```ts Node.js theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.tokengift.ai/v1",
    apiKey: process.env.TOKENGIFT_API_KEY,
  });

  const res = await client.chat.completions.create({
    model: "openai/gpt-4o-mini",
    messages: [{ role: "user", content: "Hello from a user-funded app!" }],
  });
  ```

  ```python Python theme={null}
  from openai import OpenAI
  import os

  client = OpenAI(
      base_url="https://api.tokengift.ai/v1",
      api_key=os.environ["TOKENGIFT_API_KEY"],
  )

  res = client.chat.completions.create(
      model="openai/gpt-4o-mini",
      messages=[{"role": "user", "content": "Hello from a user-funded app!"}],
  )
  ```

  ```bash cURL theme={null}
  curl https://api.tokengift.ai/v1/chat/completions \
    -H "Authorization: Bearer $TOKENGIFT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-4o-mini",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```
</CodeGroup>

Every response tells you where you stand:

```
TokenGift-Balance: 4.99
TokenGift-Request-Cost: 0.000012
TokenGift-Request-Id: req_58e69ebc955d4ecc
```

<Note>
  Today we support `POST /v1/chat/completions` (streaming and non-streaming) with a curated
  model list — see [Models & pricing](/reference/models-pricing). We say exactly what we
  support instead of claiming "full compatibility".
</Note>

## 3. Let users fund your app

Put your top-up link anywhere — a button, your README, your app's settings page:

```html theme={null}
<a href="https://tokengift.ai/fuel/my-app">⚡ Fuel this app</a>
```

Users see a gift-card style page with clean amounts only ($5 / $10 / $25 / $50). A $10
purchase puts **exactly $10.00\*\* in your wallet — no fees, no shrinkage.

## 4. Handle an empty wallet

When the wallet can't cover a request you get an actionable `402` — the error itself is
your funding prompt. See [Handle an empty wallet](/guides/handle-empty-wallet).
