Hatz AI REST API

Explore Hatz AI's API reference. Hatz AI provides software tools and libraries to accelerate development.

The API provides access to all models on the Hatz AI platform and includes two main LLM interface patterns:

  • Hatz-native Chat Completions (/v1/chat/completions) with the Hatz harness, recursive tool calling, and server-side tools.
  • OpenAI-compatible Responses (/v1/openai/responses) for clients that expect OpenAI Responses wire format.
  • Anthropic-compatible Messages (/v1/anthropic/messages) for clients that expect Anthropic Messages wire format.

For OpenCode and other OpenAI-provider clients, start with OpenAI Responses. For Claude Code, Anthropic SDK clients, and Anthropic-provider clients, start with Anthropic Messages.

We also do have a TypeScript SDK, where you can contact the Hatz Team for access.

Base URL

The base URL for all API requests is:

https://ai.hatz.ai/v1

Authentication

The Hatz API uses API Keys for authentication. Pass your key in the X-API-Key header — it works on every endpoint:

curl 'https://ai.hatz.ai/v1/chat/models' \
  -H "X-API-Key: $HATZ_API_KEY"

The OpenAI-compatible and Anthropic-compatible endpoints also accept the same API key as a Bearer token, for clients that can only send an Authorization header (for example the OpenAI and Anthropic SDKs, OpenCode, AnythingLLM, and Jan):

Endpoint X-API-Key Authorization: Bearer
OpenAI Responses (/openai/responses) Yes Yes
Anthropic Messages (/anthropic/messages) Yes Yes
Anthropic Token Count (/anthropic/messages/count_tokens) Yes Yes
All other endpoints Yes No

On all other endpoints the Authorization header is reserved for Hatz user-session tokens, so an API key sent as Authorization: Bearer returns 401 Unauthorized. If your client can only send Bearer tokens, point it at the compatibility endpoints above.

Each API Key is scoped to a specific user, so users can make their own API Key. The API Key should provide access to the apps the user has access to.

You can generate API Keys on the platform on the Hatz Admin Dashboard by navigating to the settings tab, however you can contact the Hatz team at help@hatz.ai to request an API Key for your user.

Example Bearer call (compatibility endpoints only):

curl 'https://ai.hatz.ai/v1/openai/responses' \
  -H 'Authorization: Bearer '"$HATZ_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model": "gpt-5.2", "input": "Write a 2 sentence summary of SOC 2."}'