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

> Two paths from an Anthropic codebase into Nito.

Point the Anthropic SDK at `https://app.trynito.ai`; it reaches `POST /v1/messages` and `POST /v1/messages/count_tokens`. Or point an OpenAI-style client at Chat Completions and adapt the shape differences in the [mapping notes](/api/sdks/anthropic-drop-in/mapping-notes). Both with code: [Anthropic SDK Drop-in](/api/get-started/quickstart-anthropic-sdk).

## Through Chat Completions

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

  # Route Anthropic-style code through Nito's OpenAI-compatible surface.
  client = OpenAI(
      api_key="z_sk_your_key_here",
      base_url="https://app.trynito.ai/v1",
  )

  resp = client.chat.completions.create(
      model="moonshotai/kimi-k3",   # a Nito catalog ID from GET /v1/models
      messages=[
          {"role": "system", "content": "You are a concise assistant."},
          {"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",
    baseURL: "https://app.trynito.ai/v1",
  });

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

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

Anthropic model names are not Nito IDs; pick from `GET /v1/models`. The full Messages field list is in the [Messages reference](/api/api-reference/endpoints/messages/createanthropicmessage).

## Privacy

The level travels with the model. `:confidential` model IDs work on both Chat Completions and Messages. Encrypted runs on Chat Completions only, with extra headers; the Messages facade rejects `:encrypted` IDs. See [Privacy Levels](/privacy/levels).

## Errors

* **An Anthropic model name.** Replace it with a catalog ID.
* **A top-level `system` string on Chat Completions.** Move it into `messages`.

## Related

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

  <Card title="Anthropic SDK Drop-in" icon="gear" href="/api/get-started/quickstart-anthropic-sdk">
    Quickstart.
  </Card>

  <Card title="Mapping Notes" icon="chart-tree-map" href="/api/sdks/anthropic-drop-in/mapping-notes">
    Field by field.
  </Card>

  <Card title="OpenAI Base URL Swap" icon="file-brackets-curly" href="/api/sdks/openai-drop-in/base-url-swap">
    The OpenAI SDK.
  </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.