POST /openai/{region}/v1/images/generations. Send a prompt and an image model from your workspace. The response returns the image as b64_json.
The request uses the same Completion API scope as OpenAI Chat Completions and OpenAI Responses. Chat tools, workflow nodes, and Agent API imageGeneration are separate surfaces.
Before You Start
- API key: Create a personal API key or ask your workspace admin for a workspace API key with the Completion API scope.
Base URL
{region} path value must be eu or us. This route does not accept global.
Parameters
The request body is a strict object. Extra fields return400.
Response
A successful response is JSON withcreated and data. data contains one object with b64_json and, when the model returns one, revised_prompt. The HTTP body has no usage object. The ld-model-id response header repeats the model ID.
Generation times out after 60 seconds. A timeout returns 504 with The model did not respond in time. Please retry.
If Langdock detects that the image model refused the prompt on safety grounds, the request returns 400 with The image generation request was blocked by the content filter of the Image Model. Refused requests are not billed. Unclassified provider failures return 500.
Differences from the OpenAI API
- One image per request.
nother than1is rejected. response_formatisb64_jsononly. URL output is not supported.- HD / high-resolution generation is not supported.
- There is no public
/v1/images/editsroute.
Using the OpenAI Python library
Set Langdock as the base URL and callimages.generate:
Rate limits
The default limits are 500 RPM (requests per minute) and 150,000 TPM (tokens per minute).- RPM is enforced per workspace, model, and API key.
- TPM is shared by all API keys using the same model in a workspace.
- On Langdock Cloud, admins can set TPM for custom models in Settings > Workspace > Products > API; it caps the estimated size of a single request.
- On dedicated deployments, admins can configure custom limits per model in Settings > Workspace > Products > API.
429 Too Many Requests. Successful and rate-limited responses include x-ratelimit-limit-requests, x-ratelimit-limit-tokens, x-ratelimit-remaining-requests, and x-ratelimit-remaining-tokens.
Personal API key usage counts toward the member’s effective personal budget and the workspace spend limit together with chat and agent usage. Workspace API key usage counts toward the workspace API spend limit. Image generation calls are billed as image generation usage. See Personal API keys and Pricing.
Browser and CORS integrations are not supported. Keep API keys server-side and call the endpoint from a server, CLI, or local development tool. See API Key Best Practices.