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

# Next.js chat cookbook

> Run a full-stack ThinkFeel quickstart and multi-turn chat example.

This cookbook includes quickstart and multi-turn chat pages that call ThinkFeel through an OpenAI-compatible provider base URL.

## Local setup

```bash theme={null}
cp .env.example .env.local
npm install
npm run dev
```

## `.env.local`

```bash theme={null}
THINKFEEL_API_KEY=your_thinkfeel_api_key
THINKFEEL_PERSONA_ID=your_persona_uuid

# Optional
THINKFEEL_BASE_URL=https://playground.curvelabs.org/api/v1
```

## Included routes

| Route                  | Purpose                  |
| ---------------------- | ------------------------ |
| `GET /`                | Quickstart UI            |
| `GET /chat`            | Multi-turn chat UI       |
| `POST /api/quickstart` | Completion sample        |
| `POST /api/chat`       | Non-stream chat exchange |

## Key notes

* Uses Vercel AI SDK provider setup with ThinkFeel's OpenAI-compatible base URL.
* ThinkFeel completions are non-stream. The UI expects complete reply responses.
* Tool-calling and some OpenAI parameters remain unsupported.
* Error responses are grouped as validation, config, or provider errors.
* If overriding `THINKFEEL_BASE_URL` for this OpenAI-compatible cookbook, include `/api/v1`.
* For ThinkFeel SDK or CLI setup, use the origin only.
* Legacy `CURVE_*` environment names remain fallback-only.
* New setup should use `THINKFEEL_*` names.
