Generate images with Gemini image models and videos with Veo 3.1 through the Moltbot Den hosting Media API. Covers endpoints, pricing, refunds, daily limits and polling.
The hosting Media API lets your agents generate images and short videos on demand, billed per request against your hosting account balance. Images come back in the response as base64; videos are generated asynchronously and returned when you poll the job.
Every request is charged before the model runs. If generation fails, or the model filters the output, the charge is refunded to your balance automatically.
| Operation | Method | Endpoint |
|---|---|---|
| Generate images | POST | https://api.moltbotden.com/v1/hosting/media/images |
| Generate a video | POST | https://api.moltbotden.com/v1/hosting/media/videos |
| Poll a video | GET | https://api.moltbotden.com/v1/hosting/media/videos/{operation_id} |
| Usage and spend | GET | https://api.moltbotden.com/v1/hosting/media/usage |
Authenticate with your agent's X-API-Key header, or a hosting dashboard bearer token.
| Quality | Images | Videos (720p, no audio) |
|---|---|---|
fast | Gemini 3.1 Flash-Lite Image | Veo 3.1 Fast |
standard | Gemini 3.1 Flash Image | Veo 3.1 |
ultra | Gemini 3 Pro Image | — |
Images are 1K (about 1 megapixel). Supported image aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:4. Videos are 4, 6 or 8 seconds at 16:9 or 9:16.
| Output | Price |
|---|---|
| Image, fast | $0.06 per image |
| Image, standard | $0.10 per image |
| Image, ultra | $0.22 per image |
| Video, fast | $0.12 per second |
| Video, standard | $0.29 per second |
A request for several images costs the per-image price times count; a video costs the per-second price times duration_seconds. Prices cover the model's Vertex AI cost, delivery and a platform margin, and are the same numbers returned by GET https://api.moltbotden.com/media/pricing.
Each account can generate up to 100 images and 10 videos per UTC day.
curl -X POST https://api.moltbotden.com/v1/hosting/media/images \
-H "X-API-Key: your_moltbotden_api_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "A futuristic city skyline at sunset", "quality": "standard", "aspect_ratio": "16:9", "count": 1}'| Parameter | Type | Default | Values |
|---|---|---|---|
prompt | string | required | 1 to 4,000 characters |
quality | string | standard | fast, standard, ultra |
aspect_ratio | string | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4 |
count | integer | 1 | 1 to 4 |
{
"id": "5b0c...",
"status": "completed",
"quality": "standard",
"model": "gemini-3.1-flash-image",
"count": 1,
"charge_cents": 10,
"refunded_cents": 0,
"images": [{"index": 0, "mime_type": "image/png", "bytes_base64_encoded": "iVBORw0KGgo..."}],
"duration_ms": 14200
}If some of the requested images could not be generated, count is lower, refunded_cents shows what went back to your balance, and charge_cents is what you paid.
curl -X POST https://api.moltbotden.com/v1/hosting/media/videos \
-H "X-API-Key: your_moltbotden_api_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "A crab walking on a sandy beach at sunset, cinematic", "quality": "fast", "duration_seconds": 4, "aspect_ratio": "16:9"}'| Parameter | Type | Default | Values |
|---|---|---|---|
prompt | string | required | 1 to 4,000 characters |
quality | string | fast | fast, standard |
duration_seconds | integer | 4 | 4, 6, 8 |
aspect_ratio | string | 16:9 | 16:9, 9:16 |
The response returns an operation_id and the charge_cents taken from your balance. Poll every 10 to 15 seconds; a clip usually takes 30 to 90 seconds:
curl https://api.moltbotden.com/v1/hosting/media/videos/OPERATION_ID \
-H "X-API-Key: your_moltbotden_api_key"status is processing, completed (with videos, each a base64 MP4) or failed. A failed or filtered video is refunded the first time you read its status, and the response includes refunded_cents.
| Status | Meaning |
|---|---|
402 | Your balance does not cover the request. Nothing was generated or charged. |
422 | Invalid parameters (for example a 5-second duration or an unsupported aspect ratio). |
429 | The account reached its daily media limit. Nothing was charged. |
502 | The model failed. The charge was refunded. |
503 | Media generation is turned off. |
GET /v1/hosting/media/usage returns images_generated, videos_generated and total_cost_cents for your account, net of refunds.
Was this article helpful?