All guides
Customer-support chatbot
Most support questions are answered from a short policy and the conversation so far. A fast, inexpensive model with streaming feels instant to your customers, and you only pay for the tokens each reply uses.
Recommended models
Chosen from models whose abilities we have verified for this job. Cost is for one reply in a 5-message conversation (about 2K tokens in, 250 out), at current prices.
| Model | Input / 1M | Output / 1M | Context | Per request |
|---|---|---|---|---|
| Our pickDeepSeek V4.1 Flash deepseek/deepseek-v4.1-flash | $0.375 | $1.50 | 1.05M | $0.000938 |
| Also strongGLM 5.3 Flash z-ai/glm-5.3-flash | $0.1875 | $0.625 | 1.05M | $0.000438 |
| Lowest costgpt-oss-20b openai/gpt-oss-20b | $0.0625 | $0.5625 | 128K | $0.000234 |
How it works
- 1Write a system prompt that reads like a job description: who the bot works for, how long answers should be, and when to hand over to a human.
- 2Send the whole conversation each time (system prompt, then alternating user and assistant messages). The model has no memory between requests.
- 3Stream the reply (stream: true) so text appears word by word instead of after a pause.
- 4Trim or summarize old messages when conversations get long, so each request stays cheap.
Copy, paste, run
Set AMR_API_KEY to a key from your dashboard, install the OpenAI SDK (pip install openai or npm install openai) and run it. Swap the model for any other in the table.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aimodelsrouter.ai/v1", api_key=os.environ["AMR_API_KEY"])
MODEL = "deepseek/deepseek-v4.1-flash"
# The system prompt is your bot's job description. Keep it short and specific.
history = [{
"role": "system",
"content": "You are the support assistant for Acme Shop. Answer in 1-3 short sentences. "
"If you are not sure, say so and offer to connect the customer with a human.",
}]
def reply(message: str) -> str:
history.append({"role": "user", "content": message})
answer = ""
with client.chat.completions.create(model=MODEL, messages=history, stream=True) as stream:
for chunk in stream: # tokens arrive as they are generated
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
answer += chunk.choices[0].delta.content
print()
history.append({"role": "assistant", "content": answer}) # remember the conversation
return answer
reply("Hi, I think I was charged twice for order #1042.")
reply("What should I do next?")Tested 2026-10-28: both versions were run against the live API with each model recommended at the time, and their answers checked.
Tips
- Put facts the bot must not get wrong (prices, opening hours, refund policy) in the system prompt rather than relying on the model's general knowledge.
- Set a per-key credit limit on the key your website uses, so a bug or abuse can never spend more than you planned.
- Log the conversation ID next to the X-Generation-Id response header to trace any reply in your Activity page.
All 32 models that fit this job
- gpt-oss-20b$0.000234
- Gemma 3 27B$0.000281
- Qwen3 30B A3B Instruct 2507$0.000281
- DeepSeek V4 Flash 0423$0.00035
- DeepSeek V4 Flash 0731$0.00035
- gpt-oss-120b$0.000406
- Ministral 3 14B 2512$0.000438
- GLM 5.3 Flash$0.000438
- Gemma 4 31B$0.000494
- Nemotron Nano 12B v2 VL$0.000563
- Qwen3 235B A22B Instruct 2507$0.000563
- Llama 4 Maverick$0.000741
- Nemotron 3.5 Super VL$0.000766
- DeepSeek V4.1 Flash$0.000938
- DeepSeek V4.1 Flash 1017$0.000938
- Beam 1.0 501B A23B$0.001125
- Nemotron 3 Nano Omni$0.001219
- DeepSeek V3.2$0.001438
- Qwen3.8 27B$0.001781
- Qwen3.5 397B A17B$0.002125
- Nemotron 3 Ultra$0.002219
- MiMo-V2.5-Pro$0.002438
- Hermes 4 405B$0.002813
- Kimi K2.6$0.003031
- Kimi K2.7 Code$0.003031
- DeepSeek V4 Pro 0813$0.003713
- GLM 5.1$0.004
- GLM 5.2$0.004
- GLM 5.3$0.004
- DeepSeek V4 Pro 0423$0.00435
- Qwen3.8 Max (open weights, 2.4T A95B)$0.005625
- Kimi K3$0.0103