Text models (Gemini)
In addition to the image models, Moonez.ai serves Google Gemini text models over a Google-compatible API. You can use the official Google Gemini SDK or plain HTTP — just point it at our endpoint and authenticate with your API key.
Text is billed per token ($ per 1M tokens, input and output separately). The exact
prices for your account are shown in the panel under Pricing → Text Gemini.
Available models
Section titled “Available models”| Model | Notes |
|---|---|
gemini-3-flash-preview |
Preview |
gemini-3.1-flash-lite |
Latest lite |
gemini-3.1-pro-preview |
Preview pro |
gemini-3.5-flash |
Current fast line |
gemini-3.5-flash-lite |
Current lite |
gemini-3.6-flash |
Latest flash |
gemini-3.7-flash |
Latest flash |
Gemini Omni (gemini-omni-1.1-flash, multimodal real-time) is served over the same
Google-compatible API but is managed as a video-category model — see
Models.
Base URL
Section titled “Base URL”https://api.moonez.ai/api/gemini/v1betaAuthenticate with your platform API key in the x-goog-api-key header (exactly like the
Google API key header):
x-goog-api-key: bh_...Non-streaming: generateContent
Section titled “Non-streaming: generateContent”curl https://api.moonez.ai/api/gemini/v1beta/models/gemini-3.5-flash:generateContent \ -H "x-goog-api-key: bh_..." \ -H "Content-Type: application/json" \ -d '{ "contents": [{ "role": "user", "parts": [{"text": "Explain quantum computing in one sentence."}] }] }'The response is a standard generateContent payload:
{ "candidates": [ { "content": { "role": "model", "parts": [{ "text": "Quantum computing uses qubits..." }] } } ], "usageMetadata": { "promptTokenCount": 14, "candidatesTokenCount": 21, "totalTokenCount": 35 }}Streaming: streamGenerateContent
Section titled “Streaming: streamGenerateContent”Add alt=sse and the response is a real Server-Sent Events stream, chunk by chunk — the
same format the Google SDK consumes:
curl https://api.moonez.ai/api/gemini/v1beta/models/gemini-3.6-flash:streamGenerateContent?alt=sse \ -H "x-goog-api-key: bh_..." \ -H "Content-Type: application/json" \ -d '{"contents": [{"role": "user", "parts": [{"text": "Write a haiku about servers."}]}]}'Each data: line is a generateContent chunk; the final chunk carries usageMetadata
with the exact token counts that your balance is charged against.
Billing
Section titled “Billing”- Charged per token at the end of the request, using the actual
usageMetadatareturned by the model (input price × prompt tokens + output price × candidates tokens). - Prices are set by the platform (visible in your panel); nothing is billed for a request that fails or is interrupted before a response.
- A reservation is placed while the request streams and is settled (or released) when the stream completes or is aborted.
Unified jobs API
Section titled “Unified jobs API”Text models are also available through the platform’s own jobs API — the same
POST /api/v1/generations endpoint used for image and video models:
curl -s -X POST https://api.moonez.ai/api/v1/generations \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3.5-flash", "prompt": "Explain quantum computing in one sentence.", "aspect_ratio": "auto", "resolution": "1K" }'The call returns 202 Accepted with a job_id; poll
GET /jobs/{job_id} until the job is done. On success the
generated text is in result.text.
Billing is per token, exactly like the Google-compatible API: a reservation is placed at
creation (estimated from the prompt) and settled against the actual token usage when
the job completes — the unused part of the reservation is released back to your balance.
The exact token counts are visible in usage of the job response.