# Imagen 4 > Advanced image generator producing photorealistic images up to 2K resolution with diverse styles and fast rendering. ## Overview - **Model ID**: `imagen-4` - **Category**: image - **Provider**: google - **Status**: model_ready - **Screenshot**: `https://assets.modelslab.com/generations/6570e8e8-45e4-4dd8-a636-0fd599ad306b.webp` ## API Information This model can be used via our HTTP API. See the API documentation and usage examples below. ### Endpoint - **URL**: `https://modelslab.com/api/v7/images/text-to-image` - **Method**: POST ### Parameters - **`prompt`** (required): prompt - Type: textarea - **`aspect_ratio`** (required): t tells you the shape of an image by comparing its width to its height. For example, 1:1 is square, 3:4 and 4:3 are slightly tall or wide, 9:16 is vertical, and 16:9 is wide - Type: select (options: 1:1, 3:4, 4:3, 9:16, 16:9) ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v7/images/text-to-image \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "imagen-4", "prompt": "a regal knight in ornate, reflective golden armor with intricate blue accents, wearing a deep royal blue cape adorned with gold embroidery, sitting proudly on a majestic white horse. the knight’s helmet features a tall blue plume. the horse is also dressed in elaborate golden and blue tack, standing gracefully on a stone step partially surrounded by water. in the background, there is a grand palace with classical columns, arches, and marble statues, evoking renaissance or baroque architecture. lush greenery frames the scene, adding a serene, enchanted garden ambiance. the lighting is bright and natural, casting soft reflections in the water below", "aspect_ratio": "1:1" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v7/images/text-to-image", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "imagen-4", "prompt": "a regal knight in ornate, reflective golden armor with intricate blue accents, wearing a deep royal blue cape adorned with gold embroidery, sitting proudly on a majestic white horse. the knight’s helmet features a tall blue plume. the horse is also dressed in elaborate golden and blue tack, standing gracefully on a stone step partially surrounded by water. in the background, there is a grand palace with classical columns, arches, and marble statues, evoking renaissance or baroque architecture. lush greenery frames the scene, adding a serene, enchanted garden ambiance. the lighting is bright and natural, casting soft reflections in the water below", "aspect_ratio": "1:1" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v7/images/text-to-image", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "imagen-4", "prompt": "a regal knight in ornate, reflective golden armor with intricate blue accents, wearing a deep royal blue cape adorned with gold embroidery, sitting proudly on a majestic white horse. the knight’s helmet features a tall blue plume. the horse is also dressed in elaborate golden and blue tack, standing gracefully on a stone step partially surrounded by water. in the background, there is a grand palace with classical columns, arches, and marble statues, evoking renaissance or baroque architecture. lush greenery frames the scene, adding a serene, enchanted garden ambiance. the lighting is bright and natural, casting soft reflections in the water below", "aspect_ratio": "1:1" }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/text-to-image/imagen-4) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)