---
title: "Send generation message"
method: POST
path: "/v1/developer/projects/{project_id}/chat/messages/"
tags: ["Chat"]
---

# Send generation message

`POST /v1/developer/projects/{project_id}/chat/messages/`

## Request

- Base URL: `https://screensdesign.com`
- URL: `https://screensdesign.com/v1/developer/projects/{project_id}/chat/messages/`
- Auth: HTTP bearer

Send a natural-language prompt to generate or modify screens in a project. Returns immediately with a `run_id` (status 202). Poll the run status URL to check progress, or use `?wait=true` to block up to 300 seconds for the result.

**Image references**: Pass an `images` array to include up to 5 reference images (logos, screenshots, brand marks). Each image must be base64-encoded (max 5 MB decoded, formats: PNG, JPEG, WebP). The server validates each image, strips metadata, and re-encodes it before storage.

**Idempotency**: Pass an `Idempotency-Key` header (any unique string, max 255 chars). If the same key is sent again, the existing run is returned instead of creating a new one. This makes retries safe.

**Concurrency**: Only one run is allowed per project at a time. If a run is already in progress, returns 409 with the active run ID.

## Path parameters

- `project_id` integer, required

## Query parameters

- `wait` boolean

## Headers

- `Idempotency-Key` string

## Request body

- DeveloperSendMessageRequestRequest
  - `prompt` string, required: Natural-language description of what to generate or modify.
  - `images` object[]: Optional list of base64-encoded reference images. Each item is an object with a 'data' field (base64 string, optionally as a data URL like 'data:image/png;base64,...') and an optional 'content_type'. Max 5 images, 5 MB each. Allowed formats: PNG, JPEG, WebP. Server validates and re-encodes every image, stripping metadata.

## Response `200`

Sync mode (`?wait=true`): generation completed within 300s. Returns the full result.

- object

## Other responses

- `202`: Async mode (default) or sync timeout: returns the run ID for polling.
- `400`: Invalid request body or query parameters.
- `401`: Missing or invalid API key.
- `403`: Your API key is missing the required scope for this endpoint.
- `404`: The requested resource doesn't exist or doesn't belong to your organization.
- `409`: A generation is already in progress for this project. Wait for the active run to finish before sending a new message.
- `429`: Rate limit exceeded. Wait and retry.

---

[API](https://skmtc.dev/screensdesign/apis/screensdesign-create-developer-api.md) · [All operations](https://skmtc.dev/screensdesign/apis/screensdesign-create-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/screensdesign/apis/screensdesign-create-developer-api/revisions/8c2fab15e11c?raw)
