---
title: "Create Images from Text V2"
method: POST
path: "/api/ai/images/generate/v2"
---

# Create Images from Text V2

`POST /api/ai/images/generate/v2`

## Request

- Base URL: `https://api.worqhat.com`
- URL: `https://api.worqhat.com/api/ai/images/generate/v2`
- Auth: API key in header `x-api-key` and API key in header `x-org-key`
- TypeScript: <https://skmtc.dev/worqhat/apis/worqhat-ai-api-endpoints/docs/api/ai/images/generate/v2/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `height` 512 | 768: Height of the image to be generated. You can only choose between 512 and 768. All other values will be ignored.
  - `width` 512 | 768: Width of the image to be generated. You can only choose between 512 and 768. All other values will be ignored.
  - `prompt` string[]: The prompt to be used to generate the image.
  - `image_style` string: The image style to be used to generate the image.
  - `output_type` 'url' | 'blob': The output type of the image to be generated.

## Response `200`

Success

- ImageGenerationResponse
  - `id` string: The unique identifier associated with the image generation process.
  - `status` string: The status of the image generation process.
  - `timestamp` integer: The timestamp when the image generation request was processed.
  - `content` union: The output of the image generation process.
    - string: URL format
    - string: Base64 format
  - `processing_count` integer: The number of times the image has been processed to generate the output.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized - Invalid API Key or Organization Key
- `404`: Not Found
- `406`: Not Acceptable - Invalid Content Type or Content not supported
- `500`: Internal Server Error

## Changes

- **2023-06-26** `59c1df819bec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/worqhat/apis/worqhat-ai-api-endpoints/changes/api/ai/images/generate/v2/post.md)

---

[API](https://skmtc.dev/worqhat/apis/worqhat-ai-api-endpoints.md) - [All operations](https://skmtc.dev/worqhat/apis/worqhat-ai-api-endpoints/llms.txt) - [OpenAPI document](https://skmtc.dev/worqhat/apis/worqhat-ai-api-endpoints/revisions/a1044e79bd85?raw)
