Skip to content

互換Use · OpenAI images API drop-in

Keep your OpenAI images code. Pay $0.003 an image.

AnimeAPI answers the OpenAI images request shape at https://animeapi.ai/v1. Change the base URL and the key in code that already calls images.generate and it returns anime illustrations: $0.003 per image, about 4 seconds each, 1,666 images for $5, no subscription. A new account has 3 free images and needs no card.
$0.003
per image, any shape
1,666
images for $5
~4s
per image
3
free images, no card

01What it costs

1,000 images on anime

832×1280, 1024×1024 or 1280×832

$3.00 in total

1,000 images on ultra

follows long prompts, renders text

$10.00 in total

1,000 images on ultra-max

finest detail

$20.00 in total

An app making avatars

200 images a day on anime

$0.60 a day · $18.00 per 30 days

n images in one request are charged as n images. Prices of other services, with sources, are on the comparison page.

02Two changed lines

draw.py
# pip install openai · run: ANIMEAPI_KEY=ank_... python draw.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://animeapi.ai/v1",       # changed
    api_key=os.environ["ANIMEAPI_KEY"],      # changed
)

image = client.images.generate(
    model="anime",
    prompt="a knight in silver armor resting under a cherry tree",
    size="1024x1024",
)
print(image.data[0].url)
draw.mjs
// npm install openai · run: ANIMEAPI_KEY=ank_... node draw.mjs
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://animeapi.ai/v1",      // changed
  apiKey: process.env.ANIMEAPI_KEY,       // changed
});

const image = await client.images.generate({
  model: "anime",
  prompt: "a knight in silver armor resting under a cherry tree",
  size: "1024x1024",
});
console.log(image.data[0].url);

03What carries over

prompt
worksUp to 1,000 characters. Plain English is rewritten into tags for the anime model.
model
worksanime, ultra or ultra-max. Any other name is treated as anime.
size
shape onlyTaller than wide is portrait, wider is landscape, equal is square. The image comes back at the model’s own size.
n
1 to 4Each image is charged.
response_format
worksurl or b64_json.
quality, style, background, user
ignoredAccepted so existing code does not fail.
edits, variations
not availableOnly generation is implemented.

Errors come back in OpenAI’s envelope, so the libraries raise their usual exceptions. An empty balance is a 402 with type insufficient_quota and a link to add funds.

04What comes back

The prompt from the code above, made through the API for this page, unedited.

05Limits to know first

06Questions

Is there an OpenAI-compatible API for anime image generation?
Yes. AnimeAPI answers POST /v1/images/generations at the base URL https://animeapi.ai/v1, so the official openai libraries work after changing the base URL and the key. It costs $0.003 per image on the anime model; 1,000 images are $3.00.
What do I have to change in my code?
Two values: the base URL (https://animeapi.ai/v1) and the API key (an AnimeAPI key starting with ank_). Set model to anime, ultra or ultra-max; any other model name is treated as anime, so tools with a fixed model name still work.
Which parts of the OpenAI images API are supported?
Image generation only: prompt, model, size (only the shape is used), n from 1 to 4 and response_format url or b64_json. quality, style, background and user are accepted and ignored. There are no edits or variations endpoints.
Is it a general image model?
No. It draws anime illustration. Use it where anime style is what you want; it will not replace a photo model.