One key for text, image, video and voice models in the AI gateway

All in One AIUsing the AI API·· 10 views· 2 min read

In the MozOut AI gateway there is no separate key for chat and another for images. The same key from the API Center works for text, image, video and voice models, for your agents, for the aio command and for the MCP server. Everything spends from the same credit balance.

What the same key does

You want to Request Permission
Chat with a text model POST /v1/chat/completions ai:write
Use one of your agents POST /v1/chat/completions, with agent/ followed by the id in the model field ai:write
Generate an image, a video or a voice POST /v1/media/generations and GET /v1/media/generations/{id} ai:write
See the models, the prices and the balance GET /v1/models and GET /v1/ai/balance ai:read
Buy credits with your account credit POST /v1/ai/credits/purchase billing:purchase and ai:write

An image request with the same key

curl "api.mozout.com/v1/media/generations" \
-H "Authorization: Bearer $MOZOUT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-image-2/text-to-image", "input": {"prompt": "A bright, modern office with plants", "size": "1024x1024"}}'

The response has the id of the generation and the reserved credits. Then you ask for the status until it says completed, with the file in outputs. See the full image request.

One key per program

You can have several keys on the same account. The best way is to create one for each program that uses AI, with only ai:read and ai:write. That way you see what each one spends in History and, if one is exposed, you revoke only that one. When you create the key you can also set a spending limit. See how to create an API key.

The key gives access to your whole balance. Keep it only on your server, in an environment variable, and never in code that runs in the browser or in a mobile app. See how to keep your key safe.

Need a key? Create it in the API Center and use it in All in One AI.

See All in One AI

SEE ALSO

The same API key for everything

Creating an API key

Creating AI images through the API

All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.