# Z.AI

> Configure zai deployments and understand provider-specific behavior.

URL: https://boelabs.com/en/docs/ai-gateway/providers-zai
Language: English

## Configure a deployment

Send this body to `POST /admin/deployments` with an operator credential. Replace the example
credentials and choose a model available to your provider account. See
[Creating deployments](https://boelabs.com/docs/ai-gateway/creating-deployments) for the shared configuration fields.

```json
{ "publicModel": "glm", "adapterKey": "zai", "upstreamModel": "glm-4.7-flash", "credentials": { "apiKey": "..." } }
```

## Behavior and limitations

- **Credentials**: `apiKey` only. No `baseUrl` needed — defaults to
  `https://api.z.ai/api/paas/v4`.
- **Default transport**: Chat Completions.
- **Structured outputs**: Z.AI documents JSON mode (`response_format: {"type": "json_object"}`) with
  client-side validation, not guaranteed JSON Schema adherence, so no GLM model declares
  `structuredOutputs` or `strictTools`. A `json_schema` response format is rejected with
  `unsupported_model_capability` rather than downgraded to unvalidated JSON.
- **Reasoning**: `openai_body`, with a top-level `thinking: { type: "enabled" | "disabled" }` toggle —
  the same mechanism across every GLM model in the catalog, whether it exposes a full effort ladder or
  just an on/off switch (`levels: ["none", "high"]`). See [Reasoning](https://boelabs.com/docs/ai-gateway/reasoning).
- Catalog: `src/adapters/zai/catalog.json`.

## Next steps

- [Reasoning](https://boelabs.com/docs/ai-gateway/reasoning) — the `openai_body` / `thinking` toggle in detail.
- [Creating deployments](https://boelabs.com/docs/ai-gateway/creating-deployments) — the full request shape.

