Images

Generate images from text and edit existing images with a multipart upload. Both endpoints mirror the OpenAI Images API surface — your existing SDK code works against our base URL.

Generations

POST/v1/images/generationsauth · sk-echo

Text-to-image. Returns a JSON envelope with one or more signed asset URLs.

from openai import OpenAI

client = OpenAI(
  base_url="https://api.echotokens.me/v1",
  api_key="sk-echo-...",
)

response = client.images.generate(
  model="nano-banana-2",
  prompt="A pelican wearing a tweed jacket, oil painting, dramatic lighting.",
  n=1,
  aspect_ratio="1:1",
)

print(response.data[0].url)
print(f"Cost: {response.cost_usd_cents} cents")

Parameters

  • parameter
    model
    type
    string
    required
    required
    Image model id. See the catalog below + the live list on /pricing.
  • parameter
    prompt
    type
    string
    required
    required
    Text description of the image you want.
  • parameter
    n
    type
    integer
    required
    optional
    Number of images to return.
    default: 1
  • parameter
    image_url
    type
    string (URL)
    required
    optional
    Source image URL to use for editing / variation (where the model supports it).
  • parameter
    aspect_ratio
    type
    string
    required
    optional
    1:1, 16:9, 9:16, 4:3, 3:4. Pass either aspect_ratio OR size — not both.
    default: 1:1
  • parameter
    size
    type
    string
    required
    optional
    Pixel dimensions, e.g. 1024x1024.
  • parameter
    resolution
    type
    string
    required
    optional
    1K, 2K, or 4K — supported by some models.
  • parameter
    quality
    type
    string
    required
    optional
    low | medium | high — supported by some models.
  • parameter
    negative_prompt
    type
    string
    required
    optional
    Text describing what to avoid in the image.
  • parameter
    output_format
    type
    string
    required
    optional
    png | jpeg | webp. Controls the format of the returned signed URL's payload.
    default: png

Response

response · 200
{
"created": 1779537000,
"data": [
  {
    "url": "https://api.echotokens.me/v1/assets/eyJ1Ij..."
  }
],
"cost_usd_cents": 4
}
url is a signed link to our /v1/assets host (24-hour TTL). Download the bytes or rebuild the request before it expires.

Image edits

POST/v1/images/editsauth · sk-echo

Image-in, image-out — multipart upload. Use this when you want to modify an existing image rather than generate from text alone.

from openai import OpenAI

client = OpenAI(
  base_url="https://api.echotokens.me/v1",
  api_key="sk-echo-...",
)

with open("input.png", "rb") as image:
  result = client.images.edit(
      model="nano-banana-2",
      image=image,
      prompt="Replace the sky with a starlit night.",
      n=1,
  )

print(result.data[0].url)

Parameters

  • parameter
    model
    type
    string
    required
    required
    Image model id supporting edits.
  • parameter
    prompt
    type
    string
    required
    required
    Edit instructions in plain English.
  • parameter
    image
    type
    file (multipart)
    required
    required
    Source image. PNG, JPEG, or WebP.
  • parameter
    n
    type
    integer
    required
    optional
    Number of variations.
    default: 1
  • parameter
    size
    type
    string
    required
    optional
    Output dimensions (model-dependent).
  • parameter
    quality
    type
    string
    required
    optional
    low | medium | high (model-dependent).
  • parameter
    output_format
    type
    string
    required
    optional
    png | jpeg | webp.
    default: png
OpenAI-compatible mask field

The edits endpoint is OpenAI-compatible — clients like OpenWebUI and LibreChat work out of the box. The OpenAI SDK's mask parameter (transparent pixels are regenerated) is passed through verbatim where the model supports it.

Picking a model

The catalog below auto-syncs from the upstream every six hours, so it always reflects what's available right now. The pricing page is the canonical source for per-model rates.

all image models
Loading model catalog…

catalog auto-syncs from the upstream every 6h · canonical pricing at /pricing

nano-banana-2 (Google) is a solid default — start with that if you're not sure. Switch the model string to try a different provider; the request shape stays identical.

bill awareness

Image generations bill per output. Watch the cost_usd_cents field while you iterate — the usage page shows per-request cost so you can ballpark a batch run before launching it.

try it in the studio
Image studio

Generate or edit images in the portal — no code required. Useful for iterating on a prompt before wiring it into your app.