Create images
POST/images/generations
Turns a prompt into images with FLUX.1 [schnell], in OpenAI's format: the official SDKs work as they are (client.images.generate). Images come back as JPEG, base64-encoded; Evanesca hosts and keeps none of them.
SoonOpening soon: what follows describes the service as it will work.
https://evanesca.app/api/v1/images/generationsOpens at launchBearer $EVANESCA_API_KEYAuthorizationstringrequiredBearer followed by your key, which starts with sk-eva-.
Content-Typestringrequiredapplication/json: the body is JSON.
Request body
application/jsonmodelstringrequiredFLUX.1 [schnell], by Black Forest Labs (Germany).
promptstringrequiredThe description of the image, 400 characters at most.
nintegerHow many images to make.
sizestringThe size of each image, in pixels.
response_formatstringb64_json puts each image in data[].b64_json; url returns a data URL rather than a link, since Evanesca hosts no image.
Where it runs, what it costs
Evanesca · on the record
- Runs in
- Infomaniak · Switzerland
flux-schnell
- Infomaniak · Switzerland
- Operator keeps
Infomaniak states that queries are “neither recorded nor used to train models” (Infomaniak AI Tools).
- Costs
- €0.0092 per second of generation, VAT included, rounded up to the next second, one second at least; usage.generation_seconds is what is billed. About 2 seconds, so about €0.02, for a typical FLUX.1 [schnell] image. A refused request costs nothing.
- Response headers
x-evanesca-operator: infomaniakx-evanesca-location: switzerland
What leaves Evanesca
The prompt go to Infomaniak, in Switzerland — outside the EU, under an EU adequacy decision; the images come back in the response and Evanesca keeps none of them. The images carry IPTC metadata marking them as AI-generated (AI Act, art. 50(2)) — metadata, not a watermark, so a screenshot or a re-encode can remove it (Images).
Errors
| Status | type | Meaning |
|---|---|---|
| 400 | invalid_ | A prompt missing or over 400 characters, n outside 1 to 5, a size not in the list, or a multipart body — the param field says which (limits). |
| 401 | invalid_ | No key, a malformed key, or a revoked one. |
| 402 | insufficient_ | Your credit is at zero or below. Add credit to continue. |
| 404 | model_ | Unknown ID, a model Evanesca does not serve, or photomaker-v2, which is served by /images/edits. |
| 502 | upstream_ | The operator could not be reached, sent an unreadable answer, or turned down Evanesca's own account. Your key is not the problem: retry. |
Other operator errors reach you with its status and body, and Retry-After when it sends one (errors).
curl https://evanesca.app/api/v1/images/generations \
-H "Authorization: Bearer $EVANESCA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-schnell",
"prompt": "A lighthouse at dusk, watercolour",
"size": "1024x1024"
}'import base64, os
from openai import OpenAI
client = OpenAI(base_url="https://evanesca.app/api/v1", api_key=os.environ["EVANESCA_API_KEY"])
result = client.images.generate(
model="flux-schnell",
prompt="A lighthouse at dusk, watercolour",
size="1792x1024",
)
with open("image.jpg", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))import { writeFile } from "node:fs/promises";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://evanesca.app/api/v1", apiKey: process.env.EVANESCA_API_KEY });
const result = await client.images.generate({
model: "flux-schnell",
prompt: "A lighthouse at dusk, watercolour",
size: "1792x1024",
});
await writeFile("image.jpg", Buffer.from(result.data[0].b64_json, "base64"));package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"model": "flux-schnell", "prompt": "A lighthouse at dusk, watercolour", "size": "1024x1024"}`)
req, err := http.NewRequest("POST", "https://evanesca.app/api/v1/images/generations", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVANESCA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}{
"created": 1791763200,
"model": "flux-schnell",
"data": [{ "b64_json": "/9j/4AAQSkZJRgABAQ…" }],
"usage": { "generation_seconds": 2, "images": 1 }
}{
"error": {
"message": "'size' must be one of: 1024x1024, 1792x1024, 1024x1792. Nothing was charged.",
"type": "invalid_request",
"param": "size"
}
}