Image generation
POST /openapi/v1/images/generationsAsync mode is recommended: submission immediately returns taskId, then poll for image results. Synchronous mode remains available for existing integrations.
Use your personal API Key to call PromptHub image and video generation APIs. Both support asynchronous task polling; image generation also remains compatible with synchronous responses.
https://prompthub.xin/apiAll OpenAPI paths use this prefix. Use HTTPS in production and keep your API Key on the server.
Authorization: Bearer phk_...Send the phk_ API Key created in account settings as the Authorization header. Never place it in browser code.
01
Both image and video generation support asynchronous tasks; image generation also remains compatible with synchronous responses.
POST /openapi/v1/images/generationsAsync mode is recommended: submission immediately returns taskId, then poll for image results. Synchronous mode remains available for existing integrations.
POST /openapi/v1/videos/generationsThe create endpoint returns taskId immediately. Poll the task detail and read the final result from videos[].url.
02
Async recommended; sync supportedAsync taskAsync: 202 + taskId; sync: 200 + imagestaskId + statusAsync mode: GET /openapi/v1/images/generations/{taskId}GET /generations/{taskId}images[].urlvideos[].url