Skip to main content

API Guides & Tutorials

Image Generation

Generate images from a text prompt. OpenAI-compatible endpoint.

Overview

Generate images from a text prompt. The request and response shape match OpenAI's images.generate, so any existing OpenAI SDK works by pointing base_url at https://api.callmissed.com/v1.

Endpoint: POST /v1/images/generations

Images come back as base64-encoded PNG (or JPEG, depending on the model) in the data[].b64_json field.

app

Your app

Send a prompt, model, and size to POST /v1/images/generations

gateway

CallMissed gateway

Route to the image provider and deduct per-image credits

image

Image model

Render the image from your prompt

done

Your app

Decode data[].b64_json (base64 PNG/JPEG) and save or display it

Basic Usage

from openai import OpenAI

client = OpenAI(
    api_key="cm_your_key",
    base_url="https://api.callmissed.com/v1",
)

res = client.images.generate(
    model="flux-2-klein-9b",
    prompt="A golden retriever in a sunlit library, cinematic bokeh",
    n=1,
    size="1024x1024",
)
# res.data[0].b64_json → base64 image

Parameters

ParameterTypeDefaultDescription
modelstringModel ID (see below). Required.
promptstringText description. 1–4000 characters. Required.
ninteger1Number of images. 1–4. Billed per image.
sizestring1024x1024Width×height, e.g. 1024x1024, 768x768, 1024x1536.
response_formatstringb64_jsonOnly b64_json supported today.
negative_promptstringConcepts to avoid (e.g. "lowres, blurry").
seedintegerrandomReproducibility. Same seed + prompt + model → same image.
stepsintegerautoDenoising steps, 1–50. Higher = slower + more detail.

Response

json
{
  "created": 1731234567,
  "data": [
    { "b64_json": "<base64 PNG>", "revised_prompt": null }
  ]
}

Models

IDProviderQualitySpeedBest for
nano-banana-proGoogle (direct)FlagshipMediumMarketing infographics, accurate typography, brand-true visuals
nano-banana-2Google (direct)HighFastMultimodal (text + reference images), highest LM-Arena Elo
flux-2-devBlack Forest LabsFlagshipSlowMaximum fidelity, hero imagery
flux-2-klein-9bBlack Forest LabsHighestSlowFinal output, print, marketing
lucid-originLeonardoHighMediumCinematic, concept art
phoenix-1.0LeonardoHighMediumPhotorealistic portraits
sdxl-lightningByteDanceMediumFastPrototyping, iteration
dreamshaper-8-lcmLykonMediumFastStylised illustrations

The nano-banana-* models are routed direct (no

markup). They are paid-only — the free-tier image rows above stay on

the free plan. See Pricing below for exact per-image rates.

Sizes

Common presets: 512x512, 768x768, 1024x1024, 1024x1536, 1536x1024.

Any width/height from 64 to 4096 is accepted, but providers may clamp or round down to their supported values.

Pricing

Flat per-image price, converted to credits at 1 credit = ₹1.

ModelUSD per imageCredits per image
nano-banana-pro$0.13413.4
flux-2-dev$0.1212
flux-2-klein-9b$0.1010
phoenix-1.0$0.1010
lucid-origin$0.088
nano-banana-2$0.0676.7
sdxl-lightning$0.044
dreamshaper-8-lcm$0.044

Both nano-banana-* models are routed direct. Pricing is pass-through for a standard-resolution (1K) image.

Credits are deducted after the upstream call returns successfully. A failed generation does not cost credits.

List History

Retrieve images previously generated with your API key, newest first. Useful for galleries and audit trails.

Endpoint: GET /v1/images/history

import requests

resp = requests.get(
    "https://api.callmissed.com/v1/images/history",
    headers={"Authorization": "Bearer cm_your_key"},
    params={"limit": 20},
)
data = resp.json()
for item in data["data"]:
    print(item["id"], item["model"], item["url"])

# Paginate with the returned cursor
if data["next_cursor"]:
    next_page = requests.get(
        "https://api.callmissed.com/v1/images/history",
        headers={"Authorization": "Bearer cm_your_key"},
        params={"limit": 20, "before": data["next_cursor"]},
    ).json()
Query paramTypeDefaultDescription
limitinteger20Rows to return (1–100).
beforestringISO-8601 cursor — return rows created before this timestamp. Use next_cursor from the previous page.

Response:

json
{
  "data": [
    {
      "id": "a1b2c3d4-...",
      "url": "https://...signed-url...",
      "model": "nano-banana-pro",
      "size": "1024x1024",
      "prompt": "a red bicycle on a beach",
      "negative_prompt": null,
      "revised_prompt": null,
      "seed": 42,
      "steps": 28,
      "created": 1760000000
    }
  ],
  "next_cursor": "2026-04-12T10:00:00+00:00"
}

url is a short-lived signed link — download or re-host promptly. The API key must have image permission (otherwise 403 permission_denied). next_cursor is null on the last page.

Errors

HTTPCodeMeaning
400invalid_request_errorBad prompt / size / n. Check the parameter table.
402insufficient_creditsBalance below the request's cost. Top up in the dashboard.
403permission_deniedAPI key lacks image permission. Edit the key in the dashboard.
404model_not_foundUnknown model ID.
429quota_exceededMonthly plan cap hit. Upgrade tier.
400invalid_requestInvalid parameters (e.g. unsupported size). Upstream validation error passed through.
502upstream_errorNetwork failure reaching the image provider. No credits debited — safe to retry.
Was this page helpful?