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

# OpenAI SDK Drop-in

> Change the base URL, the key, and the model ID.

Three changes: base URL, API key, model ID. Messages, streaming, tool calls, and the response shape stay the same.

<CodeGroup>
  ```python Python 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="z-ai/glm-5.2",                      # 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 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: "z-ai/glm-5.2",                       // a Nito catalog ID
    messages: [
      { role: "user", content: "Say hello in one short sentence." },
    ],
  });

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

The base URL must end in `/v1`; the SDK appends `/chat/completions`. Use catalog IDs: `openai/gpt-5.5`, not `gpt-5.5`. See [model mapping](/api/sdks/openai-drop-in/model-mapping).

`resp.choices[0].message.content` is the text and `resp.usage` the tokens. Streaming works as in the OpenAI SDK: `stream=True` or `stream: true`.

## Privacy

On models with an attested build, the `:confidential` variant runs inside sealed hardware and returns attestation evidence:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
model="z-ai/glm-5.2:confidential"
```

Find the `:confidential` model ID in `GET /v1/models`; request fresh evidence from [Get attestation](/api/api-reference/attestation/get-attestation). See [Privacy Levels](/privacy/levels).

## Notes

* Nito also serves a stateless `POST /v1/responses` shim. Chat Completions is the primary surface.
* A `429` carries `Retry-After` and `X-RateLimit-*` headers. See [Rate Limits](/api/api-reference/errors-and-rate-limits/rate-limits).

## Related

<CardGroup cols={2}>
  <Card title="Make Your First Request" icon="play" href="/api/get-started/make-your-first-request">
    Field by field.
  </Card>

  <Card title="Chat Completions" icon="message" href="/api/features/chat-completions">
    The endpoint.
  </Card>
</CardGroup>


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