Skip to main content

AI Gateway: pay for API usage in USD

What the AI Gateway is, which API requests it bills in USD instead of Hatz credits, how pricing and budgets work, and what changes for your tenants.

The AI Gateway lets an MSP pay for API requests to Hatz's Anthropic-compatible and OpenAI-compatible endpoints in US dollars, at the published rates of the provider that serves each model plus a Hatz fee, instead of in Hatz credits. These are the endpoints that coding tools such as Claude Code, Codex CLI and OpenCode, and apps built on the Anthropic or OpenAI SDKs, connect to.

About the name: In Settings it's called AI Gateway. Permission names, notification emails and API error messages use the name LLM Gateway for the same feature. The LLM Gateways article is a different page: it describes the API endpoints themselves and how to connect a tool to them.

What the AI Gateway bills in USD

Once your MSP has activated the AI Gateway and a tenant has opted in, requests made with that tenant's Hatz API keys to these endpoints are billed in USD:

  • Anthropic Messages: https://ai.hatz.ai/v1/anthropic. See Anthropic Messages Gateway.

  • OpenAI Responses: https://ai.hatz.ai/v1/openai. This base URL serves the Responses API only.

Everything else stays on Hatz credits and works as before, including:

  • Hatz chat in the browser, agents, Workshop apps and workflows, and the Slack and email integrations.

  • The Hatz-native Chat Completions API, /v1/chat/completions.

A request is billed one way or the other, never both.

How it's turned on

  1. An MSP admin activates it in the admin console under Settings → AI Gateway, which needs the Manage LLM Gateway permission. The admin sets a combined monthly cap for all tenants, a starting budget per tenant and the highest budget a tenant can set. They then review the tenants that keep legacy credits (tenants already using these endpoints on credits, explained below), accept the billing and retention notice, and click Activate AI Gateway. Activation needs an active Hatz package for your MSP; if the page says something is missing, contact Hatz support.

  2. Each tenant opts in. A tenant admin opts in on the tenant's Connect a client page in Settings, next to API Keys. An MSP admin can also opt a tenant in from the tenants list in Settings → AI Gateway. Opting in applies the starting budget, unless the MSP has set a different default for that tenant.

  3. Users connect their tools. In an opted-in tenant, users open Connect a client to set up Claude Code, Codex CLI, OpenCode, Claude Desktop and other tools with their Hatz API key.

Activation and opt-in are one-way. Neither can be undone from Settings, and an opted-in tenant can't switch back to Hatz credits. An MSP admin can disable a tenant to stop its gateway requests, and Hatz support can suspend the AI Gateway for an MSP.

What happens to each tenant

After your MSP activates the AI Gateway, requests to the two endpoints are handled per tenant:

  • Opted in: billed in USD against the tenant's monthly budget.

  • Keeps legacy credits: a tenant that had made credit-billed requests to these endpoints with an API key before activation keeps paying in Hatz credits until it opts in. This list is fixed at activation, and the MSP admin reviews it before activating.

  • Not opted in: any other tenant, including tenants created after activation, is refused until it opts in.

  • Disabled by the MSP: refused until the MSP turns it back on. Its budget and opt-in are kept.

Tenants under an MSP that hasn't activated the AI Gateway keep using Hatz credits for these endpoints, exactly as before.

Each user also needs the Use LLM Gateway permission in their role. If you use custom roles, check that they include it.

Pricing

Gateway usage is priced at the published list rate of the provider that serves the model, plus a Hatz fee. Settings → AI Gateway shows this as: "Pricing is existing model rates plus a 10% fee for Hatz."

  • A request is priced at the rates in effect when it starts.

  • These are not charged: token counting requests, model list requests, the readiness check on Connect a client, and requests that are refused before they reach the model.

  • If a request fails or is cancelled after the model has started responding, you can be charged for the usage the provider reported up to that point.

Budgets and spend limits

  • The MSP sets a combined monthly cap for all of its tenants. When it's reached, new gateway requests stop for every tenant until the cap is raised or the next month starts. Requests already running finish.

  • Each opted-in tenant has its own monthly budget, which starts at the MSP's starting budget. A tenant admin can change it, up to the highest budget the MSP allows.

  • Budgets reset at the start of each calendar month in UTC.

  • Budgets are checked against an estimate of the most a request can cost, so a request can be refused shortly before a budget is fully used. Setting a lower output token limit on your requests helps.

  • MSP admins see a warning in the admin console when spend reaches 80% and 100% of the combined cap. Primary Admins and Admins also get an email.

Billing and credits

  • Gateway usage is billed in USD at the published rates plus the Hatz fee, separately from Hatz credits. It does not draw credits.

  • The MSP pays for the gateway usage of all of its opted-in tenants.

Request data retention

The notice an MSP admin accepts in Settings → AI Gateway states how long gateway request data is kept. The current notice says: request and response payloads are retained for 7 days for abuse investigation. Retained data is deleted at the end of that period unless an audited Hatz investigation places a hold on it, which extends retention until that hold is lifted. Access requires an audited Hatz Trust & Safety review; there is no customer-facing payload browser. The terms in the notice your MSP accepted are the ones that apply to your MSP.

If requests are refused

Gateway error messages say "LLM Gateway". The most common ones:

  • LLM Gateway is not enabled for your organization. Ask your MSP administrator to enable it, or contact Hatz support. (403): the tenant hasn't opted in. A tenant admin opts in on Connect a client, or the MSP opts the tenant in.

  • Your role does not include LLM Gateway access. (403): add the Use LLM Gateway permission to the user's role.

  • LLM Gateway access for your organization has been disabled by your provider. (403): the MSP has disabled the tenant.

  • The requested model is not available for LLM gateway billing. (403): not every model is available for USD billing. Choose one from https://ai.hatz.ai/v1/anthropic/v1/models.

  • Your tenant's LLM Gateway budget has been reached. (429): raise the tenant's budget, or wait until the next month (UTC).

  • Your organization's LLM Gateway budget has been reached. (429): the MSP's combined monthly cap has been reached. An MSP admin can raise it.

  • LLM gateway billing is temporarily unavailable. (503): Hatz couldn't confirm the billing setup for the request. Retry shortly. If it keeps happening, contact Support with the request ID from the response.

For the full list, see AI Gateway errors in the FAQs / Troubleshooting collection. Budget errors are not rate limits. They don't include a Retry-After header, and retrying won't help until the budget is raised or the next month starts. For rate limits, see LLM Gateways.

Frequently asked questions

Do we pay extra to use the API? Only if your MSP activates the AI Gateway. Without it, API requests use Hatz credits as before. With it, opted-in tenants' requests to the two endpoints are billed in USD instead of credits.

Does this change Hatz chat? No. Chat, agents, Workshop and Chat Completions stay on credits.

Can we go back to credits? No. Activation and tenant opt-in are one-way. While Hatz support has suspended the AI Gateway for an MSP, USD requests are refused and tenants that keep legacy credits continue on credits.

Which models can we use? Not every Hatz model is available for USD billing, and the list changes as models are added. Your tools can fetch the models your key can use from https://ai.hatz.ai/v1/anthropic/v1/models; /v1/chat/models also lists models that aren't available for USD billing. For opted-in tenants this list includes models from several providers, not only Claude, and the same model IDs work on both endpoints.

Related articles

Did this answer your question?