> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Wafer

> Add and configure Wafer serverless chat models through TrueFoundry's AI Gateway

[Wafer](https://wafer.ai/) is a hosted inference provider for **serverless chat models**. TrueFoundry connects to Wafer natively through the **AI Gateway**, so you can send text prompts and receive text responses with optional zero-data-retention.

Wafer supports **chat completions**, **streaming**, and **tool / function calling** (where the model supports it) for models like **GLM 5.2**.

### Adding Models

This section explains the steps to add a Wafer provider account, register chat models, and configure access controls.

<Steps>
  <Step title="Navigate to Wafer in AI Gateway">
    From the TrueFoundry dashboard, navigate to `AI Gateway` > `Models` and select `Wafer`.

    <Frame caption="Select Wafer from the provider list">
      <img src="https://mintcdn.com/truefoundry/6JNLiTQPKffhiQGL/images/wafer1.png?fit=max&auto=format&n=6JNLiTQPKffhiQGL&q=85&s=36a7edf662605ea07fab18eaae1a925b" alt="Wafer provider selection in TrueFoundry AI Gateway models page" width="1680" height="1458" data-path="images/wafer1.png" />
    </Frame>
  </Step>

  <Step title="Add Wafer account details">
    Click `Add Wafer Account`. Give a unique name to your Wafer account and complete the form:

    * **Base URL** (optional): defaults to `https://pass.wafer.ai/v1`. Change this only if Wafer directs you to a different endpoint.
    * **Zero Data Retention**: when enabled, the gateway sends the `Wafer-ZDR: required` header on API requests for request-scoped zero data retention. This is enabled by default.
    * **API Key**: your Wafer API key for authentication.

    Add collaborators to your account to grant other users or teams access. Learn more about access control [here](/docs/ai-gateway/gateway-access-control).

    <Frame caption="Wafer account configuration form">
      <img src="https://mintcdn.com/truefoundry/Tn2QPKAroqlJojuN/images/wafer-new-2.png?fit=max&auto=format&n=Tn2QPKAroqlJojuN&q=85&s=618fcfeb653eca025d4c66698fd7189e" alt="Wafer account form with API key, models, and Base URL fields" width="1287" height="700" data-path="images/wafer-new-2.png" />
    </Frame>
  </Step>

  <Step title="Register chat models">
    Click `+ Add Models` to register one or more chat models under your Wafer account. For each model, set:

    * **Display Name**: the name shown in the TrueFoundry UI (for example, `glm-5.2`).
    * **Model ID**: the Wafer model identifier used in API calls (for example, `GLM-5.2`).
    * **Model Types**: select **Chat**.

    <Frame caption="Add a Wafer chat model">
      <img src="https://mintcdn.com/truefoundry/ZXnb_9uE9FzMsAAE/images/GLM5.2.png?fit=max&auto=format&n=ZXnb_9uE9FzMsAAE&q=85&s=54a292312453476297fcff5039f6c3ce" alt="Wafer model form with Display Name, Model ID, and Model Types for GLM-5.2" width="1286" height="582" data-path="images/GLM5.2.png" />
    </Frame>

    <Note>
      Use the exact **Model ID** from Wafer's documentation or dashboard. A common model is `GLM-5.2`.
    </Note>
  </Step>
</Steps>

### Inference

After adding the models, call them through the AI Gateway like any other chat model — via the Playground or by integrating with your application using the OpenAI-compatible `/chat/completions` API.

Use the TrueFoundry model ID in the format `your-wafer-account/glm-5.2`. See [Chat Completions - Getting Started](/docs/ai-gateway/chat-completions-overview#getting-started) for a full code example:

```python lines theme={"dark"}
from openai import OpenAI

client = OpenAI(
    api_key="your_truefoundry_api_key",
    base_url="{GATEWAY_BASE_URL}"
)

response = client.chat.completions.create(
    model="my-wafer-account/glm-5.2",  # provider account / model display name
    messages=[{"role": "user", "content": "Hello, how are you?"}]
)

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