---
title: "Start OpenAI brochure generation"
method: POST
path: "/api/listings/{id}/brochure/openai-generate"
---

# Start OpenAI brochure generation

`POST /api/listings/{id}/brochure/openai-generate`

## Request

- Base URL: `https://gstcranes.com`
- URL: `https://gstcranes.com/api/listings/{id}/brochure/openai-generate`
- Auth: API key in cookie `auth_session`

Browser-session admin workflow for brochure image generation. Send mode=async to start a background job; the response is HTTP 202 with a Location header that clients can poll through openai-status.

## Path parameters

- `id` string, required

## Headers

- `GST-API-Version` string
- `Idempotency-Key` string

## Request body

- AsyncBrochureGenerateRequest
  - `mode` 'sync' | 'async': Use async to start a background generation job and poll status later.
  - `style` 'A' | 'B' | 'C' | 'all'
  - `quality` 'low' | 'medium' | 'high'
  - `size` '1024x1024' | '1536x1024' | '1024x1536'
  - `caller` string

## Response `200`

Synchronous brochure generation result.

- AsyncBrochureSyncResult
  - `listing_id` string, required
  - `styles` string[], required
  - `results` AsyncBrochureResult[], required
    - `style` 'A' | 'B' | 'C', required
    - `status` 'ok' | 'error'
    - `url` string, nullable
    - `email_html` string, nullable
    - `cost_estimate_usd` number, nullable
    - `error` string, nullable
    - `created_at` integer, nullable
  - `total_cost_estimate_usd` number, required

## Other responses

- `202`: Async brochure generation job accepted.
- `400`: Invalid request.
- `401`: Browser session required.
- `403`: Access forbidden or account action required.
- `404`: Resource not found.
- `429`: Rate limit exceeded.
- `500`: Unexpected server error.
- `503`: Required backend service is temporarily unavailable.
- `default`: Machine-readable API error.

---

[API](https://skmtc.dev/gstcranes/apis/gst-cranes-companies-api.md) · [All operations](https://skmtc.dev/gstcranes/apis/gst-cranes-companies-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gstcranes/apis/gst-cranes-companies-api/revisions/0248d238b736?raw)
