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

# TanStack AI

> Use Phaseo with TanStack AI's OpenAI-compatible adapter.

Use TanStack AI when you want type-safe chat flows in React, Solid, Preact, Vue, Svelte, or server-side TypeScript.

## Install

```bash theme={null}
npm install @tanstack/ai @tanstack/ai-openai
```

## Configure the adapter

```ts theme={null}
import { chat } from "@tanstack/ai";
import { openaiCompatible } from "@tanstack/ai-openai/compatible";

const phaseo = openaiCompatible({
	name: "phaseo",
	baseURL: "https://api.phaseo.ai/v1",
	apiKey: process.env.PHASEO_API_KEY!,
	models: ["openai/gpt-5-nano", "anthropic/claude-sonnet-4.5"],
});

const stream = chat({
	adapter: phaseo("openai/gpt-5-nano"),
	messages: [{ role: "user", content: "Reply with only: ok" }],
});
```

## Notes

* Declare the Phaseo model ids you plan to use in the `models` array.
* The OpenAI-compatible adapter defaults to Chat Completions. Use direct API calls for Responses-only features.
* If a model does not support tools or images in your workflow, declare narrower capabilities in TanStack AI so TypeScript catches unsupported calls earlier.

## Related

* [OpenAI SDK](./openai-sdk.mdx)
* [Tool Calling](../tool-calling.mdx)
* [Models](../../api-reference/endpoint/models.mdx)
