Reve API - Docs - v2/create
v2 Create
Create images from a text description with optional raw reference images. Image generation requests commonly take 40–80 seconds to complete. Configure HTTP clients, load balancers, and job runners with request timeouts of at least 120 seconds. To learn more about the pricing for this endpoint, visit the pricing page.
POST https://api.reve.com/v2/image/create
Playground
Request Headers
- Authorization: string required. The API Key provided as a bearer token.
- Accept: string. One of image/png, image/jpeg, image/webp or application/json. For images, the response will be the bytes directly in the requested format, with the additional information provided as custom headers. For JSON, the response will be an object with the image base64 encoded (png) with additional information provided as separate properties. Default: application/json
Request Body
- prompt: string required. The text description of the desired image. The maximum length is 4000 characters. You can refer to a reference image by frame:
<frame>N</frame>is the Nth entry in references (0-based, so the first reference is<frame>0</frame>). - references: array. An optional list of raw reference images. Each entry is an image object with exactly one of data (the image data, base64 encoded in JSON or a file part in form-data) or ref (an identifier string, either id:
for a previously stored image or generation, or reference:@ for a named reference entity in your project). - aspect_ratio: string. The desired aspect ratio of the generated image: one of 4:1, 3:1, 21:9, 2:1, 17:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 1:2, 1:3, 1:4, auto. With auto, the model picks an appropriate aspect ratio for the request. Default: auto
- postprocessing: array. An optional list of postprocessing operations to apply to the generated image, such as upscaling, background removal, or effects.
- version: string. An optional public model version alias.
JSON Request
REVE_API_KEY=""
# Make the API request
curl -X POST https://api.reve.com/v2/image/create \
-H "Authorization: Bearer $REVE_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A high-quality photo of a wine bottle and glasses on a rustic surface. The mood is warm and inviting, with a color palette dominated by earthy terracotta, warm peach, and soft beige. The lighting is bright and directional from the upper left, casting long, soft shadows across the scene.\n\nIn the center of the frame stands a tall, slender wine bottle filled with a peach-colored rosé wine. The bottle has a metallic rose-gold foil capsule covering the neck and cork. A white rectangular label is centered on the body of bottle with black serif text that reads \"YVES\" in a small font, \"ROSÉ\" in a large, bold font, and \"Côtes de Provence - 2024\" in a smaller font at the bottom. The liquid inside bottle reflects the warm light, showing highlights and shadows.\n\nTo the image-left of bottle is an empty, stemless wine glass. To the image-right of bottle is a second stemless wine glass partially filled with the same peach-colored rosé wine. In the foreground, lying on the surface in front of bottle and glass 2, is a single green sprig of rosemary.\n\nBehind the wine bottle and glass 2, a light beige, textured linen cloth is draped haphazardly, with its frayed edges visible. The entire arrangement sits on a surface made of square terracotta tiles with light-colored grout lines. The tiles have a slightly weathered, matte finish.\n\nThe background consists of a rustic wall made of large, irregular terracotta bricks or stones. A horizontal ledge or shelf is visible at the top of the frame, also made of the same earthy material. In the upper right corner, a dark, metallic faucet is partially visible, its vertical neck and base disappearing out of the frame. The lighting creates a strong contrast between the brightly lit areas on the left and the deeper shadows on the right, highlighting the textures of the cloth, surface, and wall.\n",
"aspect_ratio": "auto",
"version": "latest"
}'
JSON Response Body (default)
For successful responses (200 status code)
- image: string. The base64 encoded image data. This will be empty if the request was not successful.
- layout: object. A structured JSON layout the model generated for the image. Omitted on image (Accept: image/*) responses.
- version: string. The model version used in the generation process. The v2 endpoints currently always report latest.
- content_violation: boolean. Indicates whether the generated image violates the content policy. True if there is a violation, False if there isn't.
- request_id: string. A unique id for the request.
- credits_used: number. The number of credits used for this request.
- credits_remaining: number. The number of credits remaining in your budget.
For failure (non-200 HTTP status code)
- error_code: string. The type of error. Could be strings like MISSING_REQUIRED_PARAMETER, etc.
- message: string. More information about the error that occurred.
- params: object. Specific parameters related to the error, if applicable.