Create image from text

v1
post
/1/ai/{product_id}/openai/images/generations

Creat image from input prompt
Supports English primarily, with limited understanding of French (FR), German (DE), Spanish (ES), and Italian (IT).

Path parameters

product_id
requiredstring
Examples:example

Body Parameters

application/json
modelrequiredstring
Possible values:fluxsdxl_lightning

ID of the model to use.

Examples:sdxl_lightning
ninteger
Min:1Max:5

The number of images to generate (default: 1)

Examples:1
negative_promptstring

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.

Examples:asymmetry, worst quality, low quality
promptrequiredstring

A text description of the desired image(s). The maximum length is 77 tokens

Examples:A cute cat
qualitystring
Possible values:hdstandard

The quality of the image that will be generated (default: standard)

Examples:standard
response_formatstring
Possible values:b64_jsonurl

The format in which the generated images are returned. Currently, only 'b64_json' is supported as the response format

Examples:b64_json
sizestring
Possible values:1024x10241024x17921792x1024

The size of the generated images.

Examples:1024x1024
stylestring
Possible values:cinematiccomic_bookdigital_artdisney_charactorenhancefantasy_artline_artlowpolyneonpunkphotographic

Change the style to guidance for the generation

Examples:neonpunk
syncboolean

Response Body

application/json
datarequiredarrayofBase64image

Base64 image

createdrequiredinteger

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
}