Docs
API Reference

Images

Generate images through the Qufas AI OpenAI-compatible Images API.

Images

Generate images with enabled image models from the Model Registry. Use the sameqf_sk_ API keys and OpenAI SDK configuration as chat completions.

The examples currently use <enabled-image-model-id>. Use GET /v1/models for enabled official model IDs. Image examples are templates: replace <enabled-image-model-id> only after an image model is enabled. Qufas never silently remaps a model ID to another version.

Endpoint

Send requests to POST /v1/images/generations.

Examples

1import os2from openai import OpenAI3 4client = OpenAI(5    api_key=os.environ["QUFAS_API_KEY"],6    base_url="https://qufas-ai.vercel.app/v1",7)8 9image = client.images.generate(10    model="<enabled-image-model-id>",11    prompt="A cute panda drinking coffee",12    size="1024x1024",13    n=1,14    response_format="url",15)16 17print(image.data[0].url)

URL responses only

The stable API supports only response_format: url. b64_json is not a supported high-level SDK or public API capability and returns an explicit parameter error.

Response

JSON
1{2  "created": 1750000000,3  "data": [4    {5      "url": "https://..."6    }7  ]8}

Billing

Image requests are billed per generated image using the model registrybilling_type=image and unit_price. Usage logs include request ID, provider, model, API key, image count, cost, and latency.

Was this page helpful?