Try Kimi K3.1 Pro, GPT-6.1 Terra, Hy4, and Gemma 4 in AI Gateway
Shipped by Mohamed, Brenden Ehlers, Nijiko Yonskai, and Alice Wasko
Our on-call robot slept through a 3 a.m. page. So we asked every model AI Gateway added last week to write its excuse in one sentence. GPT-6.1 Terra kept it short:
“I was awake, but the page got routed to my dreams queue.”
Hy4 blamed a coworker:
“I routed the 3 a.m. page to my dream instance, which confidently marked it resolved and forgot to wake production me.”
Every model below runs on your ngrok access key and credits. You don’t need an account with Moonshot AI, OpenAI, MiniMax, Tencent, or Google, and each one accepts the same OpenAI chat completions request.
The prices on the label aren’t the whole story. The same one-sentence excuse cost $0.00012 on GPT-6.1 Terra and $0.00516 on Kimi K3.1 Pro, more than 40 times as much. Kimi always thinks before it answers, and it billed 598 tokens to write one sentence. Some details to check before you pick:
- GPT-6.1 Terra costs half as much as GPT-6.1 Sol and has a 1.05M-token context window. Prompts over 272K input tokens cost $2.00 input and $7.50 output per 1M tokens.
- Kimi K3.1 Pro can’t turn thinking off. Set
reasoning_efforttolow,high, ormaxto control how long it thinks. HighSpeed is the same model at two to three times the speed and twice the price. - MiniMax M3.1 Flash has a 1M-token context window for $0.15 per 1M input tokens. Set
reasoning_effortto trade depth for speed. - Hy4 is Tencent’s new 1M-context model with image input. AI Gateway bills TokenHub’s list price, not its launch promotion.
- Gemma 4 takes text input. Google hasn’t published paid Gemma 4 pricing, so check Models for the current Google price before you build on it. Through Google, chat completions return Gemma’s thinking inside
<thought>tags in the message. Strip the tags, or pin the request to LLM API withllmapi:google/gemma-4-31b-itto get the answer alone.
A bare model ID goes to the model’s author first and falls back to other providers that serve it. To choose the provider yourself, prefix its ID, such as qwencloud:moonshotai/kimi-k3.1-pro. The model selection guide has the details.
Get started
Create an ngrok account or sign in. Create an access key that allows your chosen provider and model, and confirm your account has credits. Every model here accepts OpenAI chat completions requests.
Optionally, give the robot’s excuse prompt to a few models in the playground first.
Follow the setup guide and select OpenAI and TypeScript.
Install the OpenAI SDK and TypeScript runner:
Save your ngrok access key in .env.local. Keep this file out of version control:
Use an ES module project ("type": "module" in package.json) for top-level await. Save this example as index.ts:
Run the example from your project directory:
It prints one excuse. Ours was “I was optimizing uptime by dreaming about it, and apparently my sleep process had higher priority than your 3 a.m. page.” Yours will be different.
To audition the other models, change model to any ID in the table, such as "openai/gpt-6.1-terra" or "tencent/hy4".
Open Activity, find each excuse request, and compare its model, provider, status, token usage, and cost. The thinking models show the gap between the price per token and the price per answer.