Image Generation [BETA]
This endpoint is currently in beta. For any issues or feedback, please contact us via Discord or support@cortecs.ai.
Generates one or more images from a text prompt using the specified image-generation model.
The image-generation model to use.
flux-2-klein-4bA text description of the image to generate.
A modern workspace with a laptop, coffee cup, and plants on a wooden desk, soft natural lighting.Number of images to generate. Provider support may vary.
1Requested output dimensions in widthxheight form. Provider support may vary.
1024x1024The format of each generated image. Provider support may vary.
The provider preference for handling the request.
Providers that may process the request.
Whether to consider only providers based and regulated within the EU.
Whether to allow quantized endpoints.
Whether to use only zero-data-retention providers.
Whether to allow model fallback when the primary model is unavailable.
Alternative models to use when model fallback is enabled.
Generated images.
Unix timestamp when the images were created.
1786007165Output dimensions when reported by the provider.
Internal server error.
from openai import OpenAI
client = OpenAI(
base_url="https://api.cortecs.ai/v1",
api_key="YOUR_SECRET_TOKEN",
)
response = client.images.generate(
model="flux-2-klein-4b",
prompt="A modern workspace with a laptop, coffee cup, and plants on a wooden desk, soft natural lighting.",
)
print(response.data)
{
"created": 1786012026,
"data": [
{
"b64_json": "<base64-encoded image>",
"revised_prompt": null,
"url": null
}
],
"size": "1024x1024",
"usage": {
"cost": 9000,
"cost_details": {
"image_generation_cost": 9000,
"prompt_cost": 0
}
}
}Last updated