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

# Hatz AI

> Connect Hatz AI to Triggr with a Hatz API key, so workflows can send prompts to any model your Hatz account can use.

Triggr sends requests to Hatz's API. A key acts as the Hatz user it belongs to, so workflows can use the models and agents that user can.

## Get an API key

In the Hatz Admin Dashboard, open Settings and generate an API key for the user whose access workflows should have. Hatz support ([help@hatz.ai](mailto:help@hatz.ai)) can also issue one. See [Hatz's API docs](https://api-docs.hatz.ai).

## Connect it in Triggr

**1. Open the integration**

Go to **Integrations > Hatz AI** and click Configure on the Base Configuration card.

![The Base Configuration card with Status Not Configured, Admin Consent Not Required and a Configure button.](https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/integrations-common/base-configuration.png?fit=max\&auto=format\&n=nyuVXZ1rouDTTEvu\&q=85\&s=bb81acb082055015f91beda7b4876f35)

**2. Enter the key**

Paste the key into apiKey and click Save Configuration. To check it, run **List Models** from a workflow: it returns the models the key can use.

## Send a prompt from a workflow

| Action | Use it for | Reply in |
| - | - | - |
| Chat Completion | Hatz's own chat API, including your Hatz agents | `choices[0].message.content` |
| OpenAI-Compatible Responses | Requests already in OpenAI's Responses format | `output_text` |
| Anthropic-Compatible Messages | Requests already in Anthropic's Messages format | `content[0].text` |
| List Models | The model names the key can use | `data` |

Each prompt action sends the JSON in `jsonBody`. **Model** is optional and replaces the model in `jsonBody`: use a model's `name` from List Models (such as `gpt-4o`), not its display name. Chat Completion also takes `agent-<id>` for one of your Hatz agents, or `auto` to let Hatz choose; with no model at all it uses `gpt-4o`.

```json theme={null}
{
  "messages": [
    { "role": "system", "content": "You are an IT service desk assistant." },
    { "role": "user", "content": "Summarise this ticket in one sentence." }
  ]
}
```

Leave `stream` unset: a step needs the whole reply. For a reply in a fixed JSON shape, set `response_format` and parse the reply text. Tool calls come back in the reply for your workflow to handle; Hatz doesn't run them.

## Rotate the key

Generate a new key in Hatz, paste it into apiKey with **Edit** on the Base Configuration card and save, then revoke the old key in Hatz.

## Troubleshooting

> **401 errors**
>
> The key is wrong or revoked: paste a current key in full.

> **429 errors**
>
> A limit on your Hatz account was reached: credit, package, model access or requests at once. Check your Hatz plan, or run fewer requests at once.

> **400 or 404 errors**
>
> Check `jsonBody` is valid JSON (escape quotes and line breaks in text from earlier steps) and the model is a `name` from List Models. `agent-<id>` and `auto` work only with Chat Completion.


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