
In short: an AI request needs three things: the address https://api.mozout.co.mz/v1/chat/completions, the key in the Authorization header and the id of a model. With curl, which already comes with Linux, macOS and Windows, you make your first request in a few minutes, without installing anything or writing a program.
Before you start
|
|
|
1. The three parts of the request
| What | Where it goes | Example |
| The address | After curl | https://api.mozout.co.mz/v1/chat/completions |
| The key | In the Authorization header | Authorization: Bearer $MOZOUT_API_KEY |
| The model | In the model field of the body | deepseek-ai/deepseek-v4-flash |
The model id always has a slash. Copy it from the Models tab of All in One AI, with the «Copy the id» button, or from the GET /v1/models list. See how to list the models through the API.
2. The request on Linux and macOS
Paste this into the terminal as it is:
curl "https://api.mozout.co.mz/v1/chat/completions" \
-H "Authorization: Bearer $MOZOUT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-ai/deepseek-v4-flash", "messages": [{"role": "user", "content": "Write a two-sentence welcome message for our website."}], "max_tokens": 200}'
max_tokens limits the length of the answer and lowers the credit reservation. Without it, the reservation counts 4096 output tokens.
3. The request on Windows
In PowerShell, the quotes inside the JSON cause trouble. The simplest way is to put the body in a file. Type notepad request.json (if Notepad asks whether to create the file, answer yes), paste this and save:
{
"model": "deepseek-ai/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Write a two-sentence welcome message for our website."}],
"max_tokens": 200
}
In the same folder, send the request with curl.exe. The @ before the name tells curl to read the body from that file:
curl.exe "https://api.mozout.co.mz/v1/chat/completions" -H "Authorization: Bearer $env:MOZOUT_API_KEY" -H "Content-Type: application/json" -d "@request.json"
4. Reading the answer
The answer comes as JSON. The text is in choices[0].message.content and the tokens counted are in usage: that is what you pay for. If finish_reason is length, the answer stopped at max_tokens. Raise the value and try again.
With a sandbox_ key, the text is always "Resposta de teste (sandbox)." and usage is zero. It means the address, the key and the model are right. Change the variable to your prod_ key and repeat to see a real answer. Add -i to the command to see the headers too: X-API-Mode says sandbox or production.
| If you get an error: 401 means the key is missing or wrong (on Windows, did you open a new terminal after setx?); 404 model_not_found means the model id is misspelt; 402 insufficient_credits means there are not enough credits for the reservation. See the AI API errors, one by one. |
| Once curl works, move to your program. With the OpenAI SDK only the address and the key change: see using the OpenAI SDK. |
|
Did your first request work? See the models and their prices in All in One AI. See All in One AI |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon) See plans |











