Calling AI from a Host app
Preview — HQ only. The AI gateway is running for Waymaker's own Solutions while billing is built. It isn't available to other organisations yet, and the details on this page can change before it is.
Your app on Host can call Claude, GPT and Gemini through one endpoint, with one key per Solution. You don't open a provider account and you don't put a provider key in your app. What the app spends is recorded against its Solution.
This is raw model access for software you build. It is separate from One, the AI inside Waymaker.
The endpoint
https://ai.waymakerone.com/v1
| Route | Compatible with |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions |
POST /v1/responses | OpenAI Responses |
POST /v1/messages | Anthropic Messages |
GET /v1/models | the models your key may call |
Streaming works on all three POST routes.
The key
A key starts with wmai_ and belongs to exactly one Solution. It is shown once, when it's
created. We keep only a fingerprint of it, so a lost key can't be shown again: revoke it and create
another. During the preview, keys are issued by Waymaker on request.
Send it as Authorization: Bearer wmai_… (OpenAI SDKs) or x-api-key: wmai_… (Anthropic SDKs).
Call from a server, never from a browser. Use your app's backend or an Ambassador, and keep the key in the environment, not in client code. The endpoint doesn't answer browser cross-origin requests.
A revoked key stops working within about a minute, everywhere.
OpenAI SDK
import OpenAI from 'openai'
const openai = new OpenAI({
apiKey: process.env.WAYMAKER_AI_KEY,
baseURL: 'https://ai.waymakerone.com/v1',
})
const stream = await openai.chat.completions.create({
model: 'anthropic/claude-sonnet-4-5',
messages: [{ role: 'user', content: 'Summarise this ticket in one line.' }],
stream: true,
})
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? '')
Anthropic SDK
import Anthropic from '@anthropic-ai/sdk'
const anthropic = new Anthropic({
apiKey: process.env.WAYMAKER_AI_KEY,
baseURL: 'https://ai.waymakerone.com/v1',
})
const message = await anthropic.messages.create({
model: 'anthropic/claude-sonnet-4-5',
max_tokens: 512,
messages: [{ role: 'user', content: 'Summarise this ticket in one line.' }],
})
The Anthropic SDK adds /v1/messages to the base URL itself, so the base URL above is the same for
both SDKs.
Models
Model names are provider/model. A key may call only the models on its allow-list; the default is:
anthropic/claude-sonnet-4-5anthropic/claude-haiku-4-5openai/gpt-4.1openai/gpt-4.1-minigoogle/gemini-2.5-flash
GET /v1/models returns your key's list. Asking for any other model returns 400 with the allowed
models named in the message.
Limits
Each key has four limits:
| Limit | Default | Allowed range |
|---|---|---|
| Requests per minute | 60 | 1–1,000 |
| Tokens per minute (input + output) | 100,000 | 1–1,000,000 |
| Output tokens per request | 4,096 | 1–64,000 |
| Tokens per day (input + output, UTC) | 2,000,000 | 1,000–50,000,000 |
Output per request. If your request asks for more output than the key allows (max_tokens or
max_completion_tokens on Chat Completions, max_output_tokens on Responses, max_tokens on
Messages), it's refused with 400. We don't shorten it for you. If your request doesn't ask for a
limit, the key's limit is applied.
Tokens per minute and per day. Before your request is sent to the model, the gateway sets aside its largest possible cost: an estimate of the input (about one token for every 3 bytes of the request body) plus the output limit. When the response finishes, the amount set aside is replaced by what the call really used. If the model provider can't be reached or returns an error, it's given back.
So a request is refused up front if it could take the key over a limit, not afterwards. To fit more requests into a minute, ask for fewer output tokens. The daily count resets at 00:00 UTC.
Images and other large inputs sent inside the request body count towards the input estimate by size. A large image can use up most of a minute's token budget, even though the model counts it as far fewer tokens.
Not available through the gateway yet
These are refused with 400:
norbest_ofabove 1. Each extra choice is billed as a full completion. Make separate requests.- Hosted tools: web search, file search, code interpreter, computer use, image generation, MCP, and Anthropic's server tools (web search, web fetch, code execution). Function tools, which run your own code, work as normal.
- Stored state on Responses:
previous_response_id,conversation, storedpromptids anditem_referenceinputs. Send the whole conversation in the request instead. - Background mode on Responses (
background: true). - Priority or flex
service_tier, and predicted outputs (prediction). Both change what a token costs.
Raising a limit
Create a new key with the limits you need, move your app to it, then revoke the old key:
waymaker host ai keys create my-solution production-v2 \
--tpm 200000 --max-output 8192 --daily-tokens 10000000
From an MCP client, use host_ai_key_create with tpm, max_output_tokens and daily_token_cap.
waymaker host ai keys list shows each key's limits. During the preview, ask Waymaker for anything
above the ranges in the table.
Errors
Errors come back in the shape your SDK expects:
| Status | Meaning |
|---|---|
401 | Missing, malformed or revoked key |
400 | Model not on the key's allow-list; the body isn't JSON; output asked for is over the key's per-request limit; n or best_of above 1; a feature that isn't available yet (above); or a request too large to ever fit the key's per-minute or daily limit |
413 | Request body over 10 MB |
429 | Over the requests-per-minute, tokens-per-minute or daily limit. Retry-After says when to try again: within the minute, or at 00:00 UTC for the daily limit |
502 / 503 | The model provider or the gateway couldn't be reached. Retry with backoff |
Every response carries an x-request-id. Quote it when you ask for help.
We don't retry a failed model call for you. A retry is a second call, and it would be billed twice.
Privacy
Prompts and completions aren't stored by the gateway. We record usage metadata only: the model, token counts, status and latency. Responses are never cached or shared between Solutions.