OpenAI-compatible image generation API
Endpoint: POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Generate an image by sending a POST request with the prompt in the messages array and optional parameters in samConfig:
All fields are optional - server uses defaults if omitted.
| Field | Type | Description |
|---|---|---|
steps |
int (1-150) | Inference steps |
guidance_scale |
float (0.0-20.0) | CFG scale |
width |
int (64-2048) | Image width |
height |
int (64-2048) | Image height |
negative_prompt |
string | Negative prompt |
seed |
int | Random seed |
scheduler |
string | Scheduler name |
euler, euler_ancestraldpm++_sde_karras (default), dpm++_2m_karrasddim, pndm, lms, heunUse cURL, Python requests, or any HTTP client to generate images.
Returns JSON with image URLs in the choices array.