Skip to main content
Images & Search

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, with a short-lived signed data[].url alongside it. Send response_format: "url" to get only the link.

  1. 1

    Your app

    Send a , , and to

  2. 2

    CallMissed gateway

    Route to the image provider and deduct per-image credits

  3. 3

    Image model

    Render the image from your prompt

  4. 4

    Your app

    Decode (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-pro",
    prompt="A golden retriever in a sunlit library, cinematic bokeh",
    n=1,
    size="1024x1024",
)
# res.data[0].b64_json → base64 image

Parameters

ParameterTypeDefaultDescription
modelstringflux-2-proModel ID (see below).
promptstring—Text description. 1–4000 characters. Required.
ninteger1Number of images. 1–4. Billed per image.
sizestringmodel defaultWidth×height, e.g. 1024x1024, 768x768, 1024x1536. Per-model limits: flux-2-pro 256–1536 px per side, flux-1.1-pro at most 1.6 megapixels in total. A size outside the model's range returns 400.
response_formatstringb64_jsonb64_json returns the image inline plus a signed url. url returns only the signed link (smaller response); if no link can be issued you get b64_json instead.
negative_promptstring—Concepts to avoid (e.g. "lowres, blurry"). At most 4000 characters. The FLUX Pro models ignore it.
seedintegerrandomReproducibility, 0–2147483647. Same seed + prompt + model → same image.
stepsintegerautoDenoising steps, 1–50, for models that take a step count. The FLUX Pro and gpt-image-* models ignore it.
reference_imagesstring[]—Up to 16 base64 PNG/JPEG images (bare base64 or a data: URL), each at most 10 MB decoded. The image is produced as an edit of these references — e.g. to place your real logo. Requires a gpt-image-* model, nano-banana-2, nano-banana-pro or gemini-3.1-flash-lite-image (those three take at most 14 images, 7 MB each, 14 MB in total).
reference_pdfstring—One base64 PDF, at most 10 MB decoded. Its extracted text is added to the prompt as brand context. Works with any model.
userstring—Your end user's id, for your own records.

Response

{
  "created": 1731234567,
  "data": [
    { "b64_json": "<base64 PNG>", "url": "https://...signed-url...", "revised_prompt": null }
  ]
}

url is a short-lived signed link — download or re-host it promptly. It is omitted when the image could not be stored, so always fall back to b64_json.

reference_images work only with gpt-image-2.5-sunburst, gpt-image-2.5-flare, gpt-image-2, gpt-image-1.5, nano-banana-2, nano-banana-pro and gemini-3.1-flash-lite-image. The three Google models take at most 14 reference images, each at most 7 MB decoded and 14 MB in total. With any other model, or over those limits, the request fails 422 before any credits are reserved, rather than quietly ignoring your references. reference_pdf only adds text to the prompt, so it works with every model.

Models

IDCreatorPlanSpeedBest for
flux-2-proBlack Forest LabsPaidMediumFlagship FLUX fidelity
flux-1.1-proBlack Forest LabsPaidFastProduction-grade at lower cost. Deprecated, sunset 2026-11-16 → flux-2-pro
gpt-image-2.5-sunburstOpenAIPaidMediumMost capable generation + editing, inpainting
gemini-3.1-flash-lite-imageGooglePaidFastLow-cost generation with reference edits
gpt-image-2.5-flareOpenAIPaidFastFast everyday generation, on-image text
gpt-image-2OpenAIPaidMediumAccurate on-image text, marketing visuals. Deprecated, sunset 2026-11-16 → gpt-image-2.5-flare
gpt-image-1.5OpenAIPaidMediumPrecise editing, logo/face preservation. Deprecated, sunset 2026-11-16 → gpt-image-2.5-flare
nano-banana-proGooglePaidMediumInfographics, accurate typography
nano-banana-2GooglePaidFastMultimodal (text + reference images)

The free plan has no image model. Every model needs Starter or above; a free key gets 403 model_not_available. The retired flux-2-klein-9b, lucid-origin, phoenix-1.0, sdxl-lightning and dreamshaper-8-lcm IDs are answered by flux-2-pro on paid plans — see Retired and deprecated models. flux-1.1-pro is currently under maintenance and returns 503 model_under_maintenance — use flux-2-pro or gpt-image-2.5-flare.

Availability fallback

If the model you asked for fails with a temporary upstream error, the request may be served by a similar fallback model instead of failing (for example gpt-image-2.5-sunburst → gpt-image-2.5-flare). A fallback is only used when your plan and the key's allowed_models permit it, never for a model under maintenance, and only with models that can honour reference_images when you sent them. You are never charged more than the price of the model you asked for: if a cheaper model served, the difference is refunded. The served model is recorded in your usage logs. Errors caused by the request itself (a content policy refusal, a bad parameter) never fall back.

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 ≈ US$0.0104 (US$1 = ₹96).

ModelUSD per imageCredits per image
gpt-image-2.5-sunburst$0.260425
gpt-image-2.5-flare$0.260425
gpt-image-2$0.260425
gpt-image-1.5$0.260425
nano-banana-pro$0.139613.4
flux-2-pro$0.104210
nano-banana-2$0.069796.7
flux-1.1-pro$0.052085
gemini-3.1-flash-lite-image$0.0353.36

Prices are for a standard-resolution (1K) image.

Reference images add a per-reference charge to each generated image on the three Google models, which are billed for every reference as input: nano-banana-2 $0.0005833 (0.056 credits), nano-banana-pro $0.001167 (0.112 credits) and gemini-3.1-flash-lite-image $0.0002917 (0.028 credits) per reference image. For example, nano-banana-2 with 3 references and n: 2 costs 2 × (6.7 + 3 × 0.056) = 13.736 credits. References cost nothing extra on the gpt-image-* models.

Credits for the request are reserved before generation and refunded in full if it fails, so a failed generation costs nothing.

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).
beforestring—ISO-8601 cursor — return rows created before this timestamp. Use next_cursor from the previous page.

Response:

{
  "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_requestThe model rejected the parameters (e.g. an unsupported size).
400content_policy_violationThe prompt or references were refused by the model's safety filter. Not billed.
402insufficient_creditsBalance below the request's cost. Top up in the dashboard.
403permission_deniedAPI key lacks image permission. Edit the key in the dashboard.
403model_not_availableA free-plan key calling a paid model.
403model_not_allowedThe key's allowed_models list excludes the model.
404model_not_foundUnknown model ID.
422—Validation failed: prompt length, n, seed, a malformed or oversized reference, or references sent to a model without an edit surface.
429quota_exceededMonthly plan cap hit. Upgrade tier.
429rate_limit_exceeded / too_many_concurrent_requestsToo many requests on this key. Retry with backoff.
503upstream_errorThe image provider failed. No credits debited — safe to retry.
503model_under_maintenanceThe model is temporarily unavailable; the message names an alternative.

On this page