AI chat and text through the API | MozOut - United States
All in One AI / Chat and text

Chat and textAsk the way you would ask a person

Chat, summarise, translate and write with hundreds of text models, through the API your code already knows.

What you can ask

  • Chat and answer
  • Summarise and translate
  • Write text and code
  • Use tools
Young man in glasses using AI on a laptop, outdoors
AI WorkspaceExample
deepseek-v4-flashdeepseek-ai/deepseek-v4-flash

Write a short welcome message for our company website.

Welcome! Here you will find everything you need, and our team is ready to help.

Type your message
Estimated cost≈ 0.01 creditsestimate
Available600+text, image, video and audio models
Example

Ask the way you would ask a person

The chat takes the messages of the conversation and returns the answer of the model you choose. Use it for an assistant on your website, to process texts in bulk or to answer inside your app.

In the My MozOut Playground you can try any text model and see what each answer cost, before writing a line of code.

Exampledeepseek-ai/deepseek-v4-flash

Write a two-sentence welcome message for our website.

Welcome! Here you will find everything you need, and our team is ready to help.

Now translate it into Portuguese.

Bem-vindo! Aqui encontra tudo o que precisa, e a nossa equipa está pronta para ajudar.

max_tokens: 200streamingcost shown on every answer
Uses

What you can do with text models

The same requests serve very different tasks. You change the model, the messages and the instructions.

Technician coding in front of a monitor
  • Chat

    An assistant on your website or app that answers your customers on the spot.

  • Summarise

    Long reports, e-mails or requests, cut down to what matters.

  • Translate

    Website copy, product descriptions and messages in other languages.

  • Write

    Drafts of copy, replies and descriptions, which you then review.

  • Code

    Explain an error, write a function or review a file.

  • Tools

    The OpenAI tools field, so the model can call functions in your system.

Models

Some models to start with

All of them accept tools (function calling). The context is how much text the model can read at once.

ModelContextWhat for
deepseek-ai/deepseek-v4-flash1,048,576 tokensFast and cheap, for background tasks and short questions.
deepseek-ai/deepseek-v4-pro1,048,576 tokensStrong reasoning, for hard problems.
qwen/qwen3.8-max1,000,000 tokensA large model, for reasoning and long texts.
zai-org/glm-5.21,048,576 tokensBuilt for agents: good with tools.
minimaxai/minimax-m2.5196,608 tokensLight and cheap, good for simple tasks.

The context, maximum output and price of each model are in GET /v1/models and on the «Models» tab.

Code

The answer as it is written

With stream: true, the text arrives in parts as the model writes, and ends with data: [DONE]. Always ask for stream_options with include_usage, so the token count comes in the last event.

  • Address: POST https://api.mozout.com/v1/chat/completions
  • Permission: ai:write on the key
  • Without streaming, the text is in choices[0].message.content.
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.mozout.com/v1",
                api_key=os.environ["MOZOUT_API_KEY"])

stream = client.chat.completions.create(
    model="moonshotai/kimi-k2.6",
    messages=[{"role": "user",
               "content": "Explain DNS in three short paragraphs."}],
    max_tokens=600,
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
How it is charged

You pay for the tokens the model used

Each model has a price in credits per 1 million input and output tokens. Input read from the cache is cheaper.

  1. We reserve

    Before calling the model, we reserve credits for the input and for the max_tokens of output.

  2. We check the balance

    If it is not enough, the answer is 402 with insufficient_credits and nothing is charged.

  3. We charge the real amount

    At the end, we charge the real tokens and return the rest of the reservation to your balance.

One request, the maths
# deepseek-ai/deepseek-v4-flash
input    1000 tokens x 56 / 1M  = 0,056
output    500 tokens x 112 / 1M = 0,056
total     0,112 -> 0,12 credits
# rounded up; minimum 0.01 per request
Good practice

Good practice for chat

A few habits avoid surprises in your balance and protect your key.

Young woman writing ideas in a notebook, outdoors
  • Keep the key on the server, in an environment variable. Never in code that runs in the browser or on a phone.
  • Always set max_tokens: it limits the answer and lowers the reservation.
  • One key per program, with only ai:read and ai:write.
  • Develop with the Sandbox: the chat answers «Resposta de teste (sandbox).» and spends nothing.
  • Check your balance with GET /v1/ai/balance before a large batch.
Frequently asked questions

Chat and text

The models, what each request costs, the credit reservation and what changes in your code.

Technical team reviewing data on the monitors
Still have questions?

Talk to us or look for the answer in the Knowledge Base.

Which text models can I use?

Hundreds, from several makers. See them on the «Models» tab in All in One AI or with GET /v1/models?type=text.

The id always has a slash, like deepseek-ai/deepseek-v4-flash.

How much does a chat request cost?

You pay for input and output tokens, at the model price in credits per 1 million tokens. Input read from the cache is cheaper.

An example on deepseek-ai/deepseek-v4-flash: 1000 input tokens and 500 output tokens cost 0.112 credits, rounded up to 0.12. The minimum per request is 0.01 credits.

How does the credit reservation work?
  1. Before calling the model, we reserve credits for the input and for the max_tokens of output.
  2. If the balance is not enough, the answer is 402 and nothing is charged.
  3. At the end, we charge the real tokens and return the rest to your balance.

When streaming, ask for stream_options with include_usage, so the count comes in the last event.

Why should I set max_tokens?

It limits the length of the answer and lowers the credit reservation.

Without it, the reservation counts 4096 output tokens, and with a low balance you may get a 402.

Do I need to change my code?

If you already use the OpenAI SDK, no. Just change the base URL, to https://api.mozout.com/v1, and the key. The request body is the same.

What is streaming?

With stream: true, the answer arrives in parts as the model writes, and ends with data: [DONE].

It is the best way to show text appearing in a chat.

Can I test without spending?

Yes, with a sandbox_ key. The API answers in the same format, but it calls no model and charges nothing:

  • the chat always answers «Resposta de teste (sandbox).»;
  • an image, video or voice is completed straight away, with a sample link and 0 credits;
  • the model list, the prices and the balance are the real ones.

When your program is ready, switch to the prod_ key.

What happens if I run out of credits?

The request does not go ahead and the API answers 402 with insufficient_credits. Nothing is charged, and the error says how much you need and how much you have.

Buy more on the «Buy credits» tab and try again. The credits arrive as soon as the payment is confirmed. In chat, a lower max_tokens also lowers the reservation.

How do I get started?

Three steps, nothing to install:

  1. Open All in One AI in My MozOut. New accounts have it on already. On older ones, click «Activate All in One AI».
  2. Use the 100 free credits in the Playground to try the models.
  3. To code, create a key in the API Center with ai:read and ai:write.
Team celebrating a result in front of the computer
Support

Need help?

If you still have questions or need more information, we have expert people ready to help you.

All in One AI

Write your first request today

Activate All in One AI, get 100 credits and try the chat in the Playground or through the API.

  • 100 free credits on activation
  • A Sandbox to test without spending
  • One key for everything

Lightning OFFER

Web Hosting + FREE Domain **

:
:
:
Stay Online!
keyboard_arrow_up Drag Up
Logo MozOut

Premium OFFER

Web Hosting + FREE Domain **

Offer ends in:
:
:
:
Stay Online!
Close