image-landscapeText to Image

How to Generate Images using the Infron AI API

To generate images using the Infron AI API, you need to send a request to the appropriate endpoint with the desired input parameters. The API uses pre-trained models to generate images based on the provided text prompt. This allows you to create images by simply describing what you want in natural language.

Here’s an example of how to generate an image using the Infron AI API from text:

curl https://image.onerouter.pro/v1/images/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: <API_KEY>" \
    -d '{
    "model": "gpt-image-1",
    "prompt": "A cute baby sea otter",
    "n": 1,
    "output_format": "url"
  }'
  • https://image.onerouter.pro/v1/images/generations is the base URL

  • <API_KEY> is your API Key generated in API pagearrow-up-right.

  • model is the model name, such as gpt-image-1, available model list can be access in Model pagearrow-up-right.

  • prompt is the prompt.

  • n is the number of images to generate, default value is 1.

  • output_format indicate the output format, default value is url.

    • b64_json

    • url

You can find more models and their descriptions in the Model pagearrow-up-right.


Example response

Last updated