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

# Mastra

> The model router, pointed at Nito.

Use the object model config for a custom endpoint:

```typescript lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
// @mastra/core
import { Agent } from "@mastra/core/agent";

export const nitoAgent = new Agent({
  name: "assistant",
  instructions: "Answer concisely.",
  model: {
    url: "https://app.trynito.ai/v1",   // base URL, WITH /v1 (not the /chat/completions path)
    id: "nito/moonshotai/kimi-k3",                         // provider/model form: a label of your choice, then the catalog ID
    apiKey: process.env.NITO_API_KEY,            // your Nito key, "z_sk_..."
  },
});
```

<Warning>
  A bare string such as `model: "openai/..."` carries no `url`, so the router resolves it to the built-in provider for that prefix. Use the object form for Nito.
</Warning>

Or an AI SDK provider instance, which Mastra accepts anywhere a model is expected:

```typescript lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { createOpenAI } from "@ai-sdk/openai";
const nito = createOpenAI({ baseURL: "https://app.trynito.ai/v1", apiKey: process.env.NITO_API_KEY });
// model: nito.chat("moonshotai/kimi-k3")
```

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
id: "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.