SparkPix API
SparkPix's ultra-fast image models with two separate endpoints. SparkPix Image generates text-to-image in under 1 second with LoRA custom style support. SparkPix Image Edit supports multi-image reference editing. Both are synchronous APIs returning results directly.
Authentication
Authorization: Bearer YOUR_API_KEYModels & pricing
| Model | Endpoint | Price | Notes |
|---|---|---|---|
| SparkPix Image | POST /api/v1/images/generations-sync | $0.0080/image | Text-to-image, sync, <1s, LoRA support |
| SparkPix Image Edit | POST /api/v1/images/edit | $0.0130/image | Multi-image editing, sync, <1s |
Code examples
# SparkPix Image: Text-to-image (sync, sub-1-second)
curl -X POST https://api.apimodels.app/v1/images/generations-sync \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cute cat wearing a space helmet, digital art",
"aspect_ratio": "16:9",
"seed": 42
}'
# SparkPix Image Edit: Multi-image editing (sync)
curl -X POST https://api.apimodels.app/v1/images/edit \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Make the background a sunset beach",
"images": ["https://example.com/photo.jpg"],
"aspect_ratio": "16:9"
}'SparkPix Image — Request parameters
POST /api/v1/images/generations-sync
| Field | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | Text description for image generation |
| aspect_ratio | No | string | "custom" (default, auto size), "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" |
| width | No | integer | Only when aspect_ratio="custom", 256-1440, must be multiple of 16 |
| height | No | integer | Only when aspect_ratio="custom", 256-1440, must be multiple of 16 |
| prompt_upsampling | No | boolean | Auto-enhance prompt with LLM (default: false) |
| seed | No | integer | Random seed for reproducibility |
| lora_weights | No | string | HuggingFace LoRA weights URL, format: huggingface.co/<owner>/<model>[/<file.safetensors>] |
| lora_scale | No | number | LoRA strength, -1 to 3, default 0.5 |
| callBackUrl | No | string | Webhook URL called when task completes |
SparkPix Image Edit — Request parameters
POST /api/v1/images/edit
| Field | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | Editing instructions. Refer to inputs as "image 1", "image 2", etc. |
| images | No | string[] | Reference image URL array, first image is the primary one |
| aspect_ratio | No | string | "match_input_image" (default, match first image), "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" |
| turbo | No | boolean | Turbo mode (default: true), recommended off for complex tasks |
| seed | No | integer | Random seed for reproducibility |
| callBackUrl | No | string | Webhook URL called when task completes |
Notes
- The two models use different API endpoints
- Both are synchronous APIs returning image URLs directly, no polling needed
- Response format: { code: 200, data: { url, model, credits, duration } }
- SparkPix Image aspect_ratio defaults to "custom" (auto), SparkPix Image Edit defaults to "match_input_image"
Try it in the Playground
FAQ
How fast is SparkPix?
SparkPix Image generates text-to-image in under 1 second and both endpoints are synchronous — the image URL comes back in the same response, no polling.
Which endpoint do I use for editing vs generation?
Text-to-image: POST /api/v1/images/generations-sync. Editing: POST /api/v1/images/edit with images[] (first image is the primary). They are separate endpoints.