Create image from text
Creat image from input prompt
Supports English primarily, with limited understanding of French (FR), German (DE), Spanish (ES), and Italian (IT).
Path parameters
Body Parameters
application/jsonID of the model to use.
The number of images to generate (default: 1)
The prompt does not guide the image generation. The maximum length is 77 tokens, Note that the "sdxl_lightning" and "flux" model does not support this feature.
A text description of the desired image(s). The maximum length is 77 tokens
The quality of the image that will be generated (default: standard)
The format in which the generated images are returned. Currently, only 'b64_json' is supported as the response format
The size of the generated images.
Change the style to guidance for the generation
Response Body
Base64 image
The Unix timestamp (in seconds) of when the response was created.
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"model": "sdxl_lightning",
"prompt": "A cute cat"
}';
$request = new Request('POST', 'https://api.infomaniak.com/1/ai/{product_id}/openai/images/generations', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"data":[{"b64_json":"example","revised_prompt":"example"}],"created":69818}