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.

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 Labs (Cloudflare)FlagshipSlowMaximum fidelity, hero imagery
flux-2-klein-9bBlack Forest Labs (Cloudflare)HighestSlowFinal output, print, marketing
lucid-originLeonardo (Cloudflare)HighMediumCinematic, concept art
phoenix-1.0Leonardo (Cloudflare)HighMediumPhotorealistic portraits
sdxl-lightningByteDance (Cloudflare)MediumFastPrototyping, iteration
dreamshaper-8-lcmLykon (Cloudflare)MediumFastStylised illustrations

The nano-banana-* models are routed direct to Google AI Studio (no

markup). They are paid-only — the Cloudflare-hosted 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 to Google AI Studio. Pricing is pass-through — exactly what Google charges for a standard-resolution (1K) image.

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

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?