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

# Make Your First Request

> Your first chat request, field by field.

You send the conversation so far as a list of messages; the model appends its reply. Non-streaming returns the whole reply as one JSON document. For piece-by-piece delivery, see [Stream Your First Response](/api/get-started/stream-your-first-response).

## The Call

<CodeGroup>
  ```bash curl wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl "https://app.trynito.ai/v1/chat/completions" \
    -H "Authorization: Bearer $NITO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "z-ai/glm-5.2",
      "messages": [
        { "role": "system", "content": "You are a concise assistant." },
        { "role": "user", "content": "Name three benefits of private AI inference." }
      ],
      "temperature": 0.7,
      "max_tokens": 300
    }'
  ```

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

  client = OpenAI(api_key="z_sk_your_key_here", base_url="https://app.trynito.ai/v1")

  resp = client.chat.completions.create(
      model="z-ai/glm-5.2",
      messages=[
          {"role": "system", "content": "You are a concise assistant."},
          {"role": "user", "content": "Name three benefits of private AI inference."},
      ],
      temperature=0.7,
      max_tokens=300,
  )
  print(resp.choices[0].message.content)
  print(resp.usage)
  ```

  ```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", baseURL: "https://app.trynito.ai/v1" });

  const resp = await client.chat.completions.create({
    model: "z-ai/glm-5.2",
    messages: [
      { role: "system", content: "You are a concise assistant." },
      { role: "user", content: "Name three benefits of private AI inference." },
    ],
    temperature: 0.7,
    max_tokens: 300,
  });
  console.log(resp.choices[0].message.content);
  console.log(resp.usage);
  ```
</CodeGroup>

The Python and TypeScript examples use the official OpenAI SDK pointed at Nito. For most apps the change is the base URL and the key.

## Request Fields

| Field | Type | Required | Meaning |
| - | - | - | - |
| `model` | string | optional | The model ID. Omitted, a default model is used. Add `:confidential` for the attested variant. |
| `messages` | array | required | The conversation. Each item is `{ role, content }`. Roles: `system`, `user`, `assistant`, `tool`, `developer`. |
| `temperature` | number | optional | Sampling randomness. Forwarded to the model. |
| `top_p` | number | optional | Nucleus sampling. |
| `max_tokens` | integer | optional | Cap on generated tokens. `max_completion_tokens` is the newer name. |
| `stream` | boolean | optional | `true` streams Server-Sent Events. Default `false`. |

`system` (or `developer`) sets instructions, `user` is the human turn, `assistant` replays a previous model turn, and `tool` carries a function result and must reference its call via `tool_call_id`. Name a model explicitly so behavior does not change when defaults change.

## Response

```json wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "...",
  "object": "chat.completion",
  "created": 1751299200,
  "model": "z-ai/glm-5.2",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "1. Your prompts stay private. 2. ... 3. ..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 64,
    "total_tokens": 92
  }
}
```

* `choices[0].message.content` is the answer. There is exactly one choice.
* `finish_reason`: `stop`, `length` (token cap), `tool_calls`, or `error`.
* `usage`: `prompt_tokens`, `completion_tokens`, `total_tokens`. Reasoning models add `reasoning_tokens`.
* `system_fingerprint` is always `null`.

## Attested Hardware

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "model": "z-ai/glm-5.2:confidential", "messages": [ ... ] }
```

Nothing else changes. A model that cannot serve the level is rejected. Afterwards, fetch and verify the attestation evidence: [How Attestation Works](/privacy/tee-attestation/how-attestation-works), [attestation endpoint](/api/api-reference/attestation/get-attestation).

## Errors

* **Empty `messages`.** At least one is required.
* **A `tool` message without `tool_call_id`.**
* **Expecting several choices.** Nito returns one. For several models on one prompt, use Model Fusion in the Browser App or Plugin.

## Related

<CardGroup cols={3}>
  <Card title="Stream Your First Response" icon="bolt" href="/api/get-started/stream-your-first-response">
    Streaming.
  </Card>

  <Card title="Check Usage" icon="chart-line" href="/api/get-started/check-usage">
    What a call used.
  </Card>

  <Card title="Chat Completions Endpoint" icon="message" href="/api/api-reference/chat-and-text/chat-completions">
    Full reference.
  </Card>
</CardGroup>


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