One of the advantages of an AI gateway is putting several models to the test with the same request, the same key and the same code. Before you choose the model for your program, it is worth seeing how three or four answer the same text and what each one spends.
In the Playground, without writing code
| 2 |
Type the request your program will make, with a real text.
|
|
| 4 |
Switch model and send the same request. Compare the answers and the cost of each one.
|
|
Through the API, with a loop
import os
from openai import OpenAI
client = OpenAI(base_url="api.interweb.ao/v1", api_key=os.environ["INTERWEB_API_KEY"])
request = [{"role": "user", "content": "Write a short reply to a customer asking about our Saturday opening hours."}]
for model in ["deepseek-ai/deepseek-v4-flash", "deepseek-ai/deepseek-v4-pro", "zai-org/glm-5.2"]:
r = client.chat.completions.create(model=model, messages=request, max_tokens=300)
print("==", model, r.usage.prompt_tokens, "+", r.usage.completion_tokens, "tokens")
print(r.choices[0].message.content)
The cost of each request is on the History tab, line by line, with the model used. See the History tab.
|
The Sandbox is no good for comparing. With a sandbox_ key no model is called: they all answer "Resposta de teste (sandbox).". To compare real answers you need the prod_ key and credits. Use short texts and a low max_tokens to spend little.
|
What to compare
| What |
Why |
| The quality of the answer |
It is what your customer will read. Use real texts, not made-up examples. |
| Tokens and cost |
Two models can give similar answers at very different prices. |
| Response time |
Measure it in your program: it depends on the model and the length of the answer. |
| Length |
Some models write more than you need, and you pay for the output too. |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon) See plans |