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

# Vercel AI SDK

> The OpenAI-compatible provider, pointed at Nito.

Use `@ai-sdk/openai-compatible` (`createOpenAICompatible`). The standard `@ai-sdk/openai` provider defaults to the Responses API.

```typescript lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
// npm i ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const nito = createOpenAICompatible({
  name: "nito",
  apiKey: process.env.NITO_API_KEY,              // your Nito key, "z_sk_..."
  baseURL: "https://app.trynito.ai/v1",  // Nito's OpenAI-compatible base URL
});

const { text } = await generateText({
  model: nito("moonshotai/kimi-k3"),                       // a Nito catalog ID, fetch from GET /v1/models
  prompt: "Say hello in one short sentence.",
});

console.log(text);
```

`streamText` streams with the same model; add `includeUsage: true` to the provider options to get token usage in the stream. Tool calling works where the model supports it. For `generateObject` and `streamObject`, set `supportsStructuredOutputs: true` on the provider and use a model that advertises `structured_outputs` in `GET /v1/models`.

With `@ai-sdk/openai` (`createOpenAI({ baseURL, apiKey })`), call `openai.chat("moonshotai/kimi-k3")`. Since AI SDK 5 the plain `openai("...")` factory calls the Responses API by default.

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
model: nito("z-ai/glm-5.2:confidential"),
```

## Privacy

Use a catalog ID, not an OpenAI name. For attested hardware use a `:confidential` variant; `GET /v1/models` lists their `:confidential` IDs. Encrypted needs client-side encryption and extra headers, which these frameworks do not add. See [Privacy Levels](/privacy/levels).

## Related

<CardGroup cols={3}>
  <Card title="Framework Integrations" icon="link" href="/api/sdks/framework-integrations">
    The shared pattern.
  </Card>

  <Card title="OpenAI Compatibility" icon="arrows-left-right" href="/api/sdks/openai-drop-in/compatibility-notes">
    What differs.
  </Card>

  <Card title="Privacy Levels" icon="file-shield" href="/privacy/levels">
    The four levels.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.