API
Image Editing & Generation
POST /api/ai/edit and /api/ai/generate — edit or generate images with AI
Image Editing & Generation
SDK equivalent: sdk.edit() + sdk.generate() — see Vision SDK
Edit Image
Edit an existing image using a natural language prompt.
Endpoint
POST /api/ai/editRequest
curl -X POST https://lab.coreviz.io/api/ai/edit \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"image": "https://example.com/photo.jpg",
"prompt": "Make it look like a vintage film photograph",
"aspectRatio": "1:1"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Image URL or base64 data URI |
prompt | string | Yes | Edit instruction |
aspectRatio | string | No | "match_input_image", "1:1", "16:9", "9:16", "4:3", "3:4" |
outputFormat | string | No | "jpg" or "png" |
model | string | No | Model override (default: "flux-kontext-max") |
Response
{ "url": "https://..." }Generate Image
Generate a new image from a text description.
Endpoint
POST /api/ai/generateRequest
curl -X POST https://lab.coreviz.io/api/ai/generate \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"prompt": "A product photo of running shoes on a white background",
"aspectRatio": "1:1"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image to generate |
referenceImages | string[] | No | Reference image URLs for style/structure guidance |
aspectRatio | string | No | Target aspect ratio |
model | string | No | Model override |
Response
{ "url": "https://..." }