Skip to main content

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-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
modelstringflux-2-klein-9bModel 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: lucid-origin up to 2500 px per side, phoenix-1.0 up to 2048, sdxl-lightning and dreamshaper-8-lcm 256–2048, 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. lucid-origin does not support it and returns 400.
seedintegerrandomReproducibility, 0–2147483647. Same seed + prompt + model → same image.
stepsintegerautoDenoising steps, 1–50. Higher = slower + more detail.
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.
reference_pdfstring—One base64 PDF, at most 10 MB decoded. Its extracted text is added to the prompt as brand context. Requires a gpt-image-* 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 and reference_pdf work only with gpt-image-2.5-sunburst, gpt-image-2.5-flare, gpt-image-2 and gpt-image-1.5. With any other model the request fails 422 before any credits are reserved, rather than quietly ignoring your references.

Models

IDCreatorPlanSpeedBest for
flux-2-klein-9bBlack Forest LabsFreeSlowFinal output, print, marketing
flux-2-devBlack Forest LabsFreeSlowMaximum fidelity, hero imagery
lucid-originLeonardoFreeMediumCinematic, concept art
phoenix-1.0LeonardoFreeMediumPhotorealistic portraits
sdxl-lightningByteDanceFreeFastPrototyping, iteration
dreamshaper-8-lcmLykonFreeFastStylised illustrations
flux-2-proBlack Forest LabsPaidMediumFlagship FLUX fidelity
flux-1.1-proBlack Forest LabsPaidFastProduction-grade at lower cost
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
gpt-image-1.5OpenAIPaidMediumPrecise editing, logo/face preservation
nano-banana-proGooglePaidMediumInfographics, accurate typography
nano-banana-2GooglePaidFastMultimodal (text + reference images)

Free-plan keys can call the six Free rows. Every Paid row needs Starter or above; a free key gets 403 model_not_available. flux-1.1-pro is currently under maintenance and returns 503 model_under_maintenance — use flux-2-pro or gpt-image-2.

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 → gpt-image-1.5). 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-dev$0.12512
flux-2-klein-9b$0.104210
flux-2-pro$0.104210
phoenix-1.0$0.104210
lucid-origin$0.083338
nano-banana-2$0.069796.7
flux-1.1-pro$0.052085
sdxl-lightning$0.041674
dreamshaper-8-lcm$0.041674
gemini-3.1-flash-lite-image$0.0353.36

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

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.
502upstream_errorThe image provider failed. No credits debited — safe to retry.
503model_under_maintenanceThe model is temporarily unavailable; the message names an alternative.