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

# Base URL Swap

> Three changes to point OpenAI SDK code at Nito.

1. **Base URL:** `https://app.trynito.ai/v1`.
2. **API key:** a `z_sk_` key.
3. **Model ID:** a catalog ID from `GET /v1/models`, not an OpenAI name.

<CodeGroup>
  ```python Python lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from openai import OpenAI

  client = OpenAI(
      api_key="z_sk_your_key_here",              # your Nito API key
      base_url="https://app.trynito.ai/v1",  # Nito's OpenAI-compatible base URL
  )

  resp = client.chat.completions.create(
      model="moonshotai/kimi-k3",                          # a Nito catalog ID, not an OpenAI name
      messages=[
          {"role": "user", "content": "Say hello in one short sentence."},
      ],
  )

  print(resp.choices[0].message.content)
  ```

  ```typescript TypeScript lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "z_sk_your_key_here",              // your Nito API key
    baseURL: "https://app.trynito.ai/v1",  // Nito's OpenAI-compatible base URL
  });

  const resp = await client.chat.completions.create({
    model: "moonshotai/kimi-k3",                         // a Nito catalog ID
    messages: [
      { role: "user", content: "Say hello in one short sentence." },
    ],
  });

  console.log(resp.choices[0].message.content);
  ```
</CodeGroup>

The SDK appends the operation path, so the base URL ends at `/v1`. A base URL ending in `/v1/chat/completions` doubles the path and fails.

| SDK call | HTTP surface |
| - | - |
| `client.chat.completions.create(...)` | `POST /v1/chat/completions` |
| `client.models.list()` | `GET /v1/models` |

`client.responses.create(...)` reaches the stateless `POST /v1/responses` shim. See [compatibility notes](/api/sdks/openai-drop-in/compatibility-notes).

The response is a standard `chat.completion` with exactly one choice; `system_fingerprint` is always `null`. Streaming, tool calling, prompt caching, and reasoning work as in the OpenAI SDK.

## Privacy

```python wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
model="z-ai/glm-5.2:confidential"   # attested hardware, with evidence you can verify
```

Find available `:confidential` variants by their IDs in `GET /v1/models`. [Encrypted](/api/api-reference/chat-and-text/encrypted) adds client-side encryption and request headers on top. See [Privacy Levels](/privacy/levels).

## Errors

* **An OpenAI model name.** `gpt-4o` is not a catalog ID. See [model mapping](/api/sdks/openai-drop-in/model-mapping).
* **No `/v1` on the base URL.**
* **An OpenAI `sk-` key.** Nito keys start with `z_sk_`.

## Related

<CardGroup cols={3}>
  <Card title="SDKs" icon="screwdriver-wrench" href="/api/sdks">
    Overview.
  </Card>

  <Card title="OpenAI SDK Drop-in" icon="book" href="/api/get-started/quickstart-openai-sdk">
    Quickstart.
  </Card>

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

  <Card title="Model Mapping" icon="chart-tree-map" href="/api/sdks/openai-drop-in/model-mapping">
    OpenAI names to Nito IDs.
  </Card>

  <Card title="Chat Completions" icon="message-dots" href="/api/features/chat-completions">
    The endpoint.
  </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.