Documentation / API

API Reference

OpenAI-compatible image generation API

Chat Completions Endpoint

Endpoint: POST /v1/chat/completions

Headers

Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Request Example

Generate an image by sending a POST request with the prompt in the messages array and optional parameters in samConfig:

SAM Config Parameters

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

Valid Schedulers

Usage Example

Use cURL, Python requests, or any HTTP client to generate images.

Response Format

Returns JSON with image URLs in the choices array.

Next Steps