API Reference
OpenAI-compatible relay for ASOP. Chat is synchronous. KREA2, REDQW21 (Qwen Image 2.1), and video use async jobs. GET /models lists currently available Create-page IDs. Do not call vendor-native paths on this host.
Base URL and auth
https://asop.uk/api/v1
Every request needs Authorization: Bearer asop-…. Tokens are created at asop.uk/api. asop.uk/api
Catalog and live quotes
These IDs work on this API. Quotes use the same estimator as Create.
List models:
curl https://asop.uk/api/v1/models \
-H "Authorization: Bearer $ASOP_API_KEY"
Each item includes id, kind, output_type, endpoints, and sync. Video kind is exposed as ref-video.
POST /chat/completions
Chat, reverse-prompt, and video-script assist under overseas content policy. Model must be prompt-assist.
| Field | Required | Notes |
|---|---|---|
model | yes | prompt-assist only |
messages | yes | OpenAI message array. Vision: user content may be an array with text and image_url |
stream | no | SSE when true |
max_tokens | no | 16–4096, default 1024 |
temperature | no | default 0.7 |
top_p | no | optional |
curl https://asop.uk/api/v1/chat/completions \
-H "Authorization: Bearer $ASOP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"prompt-assist","messages":[{"role":"user","content":"Hello"}]}'
Response is a standard chat completion. Stream chunks use text/event-stream and end with data: [DONE].
POST /images/generations
heishou-krea2 and redqw21-unlocked (aliases qwenimage2.1, qwen-image-2.1) return a job (object image.generation.job) — poll GET /jobs/{id}.
| Field | Required | Notes |
|---|---|---|
model | no | default heishou-krea2. Also redqw21-unlocked / qwenimage2.1 |
prompt | yes | max 8000 chars |
size | no | WxH such as 1024x1536, or a resolution tier |
aspect_ratio | no | 2:3 3:2 3:4 4:3 1:1 16:9 9:16 21:9 |
image_resolution | no | KREA2: 2K 6MP 12MP (default 6MP). REDQW21: 1.5MP 4MP 8MP |
krea2Mode | no | heishou-krea2: story / live / cute |
imageGenMode | no | redqw21-unlocked: txt2img / edit / ref |
redqw21PromptEnhance | no | default true |
images | no | reference file ids for edit/ref |
negative_prompt | no | optional |
seed | no | optional. Omit for random |
n | no | must be 1 if set |
curl https://asop.uk/api/v1/images/generations \
-H "Authorization: Bearer $ASOP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "heishou-krea2",
"prompt": "Wide dusk plain, rider at the ridge, 16:9",
"aspect_ratio": "16:9",
"image_resolution": "6MP",
"krea2Mode": "story"
}'
size examples: 1024x1024 → 1:1, 1024x1536 → 2:3, 1536x1024 → 3:2, 1024x1792 → 9:16, 1792x1024 → 16:9.
POST /files
Upload a reference image, video, or audio. Returns a file_id for video jobs. Images/audio max 32MB, video max 180MB.
| Field | Required | Notes |
|---|---|---|
file | yes | multipart field, or raw body with X-Filename |
purpose | no | default reference |
curl https://asop.uk/api/v1/files \
-H "Authorization: Bearer $ASOP_API_KEY" \
-F "[email protected]" \
-F "purpose=reference"
Response: {"id":"file_…","object":"file","filename":"ref.png","bytes":123,"type":"image"}
POST /jobs and GET /jobs/:id
Unified async entry. Image models (including KREA2) and all video models. When complete, output.url is a 1-hour signed URL.
| Field | Required | Notes |
|---|---|---|
model | yes | any image or video ID |
prompt | yes | max 8000 chars |
aspect_ratio | no | H3 default 2:3; other video default 9:16 |
image_resolution | no | image models only |
duration | no | video seconds (clamped to the model range) |
h3Mode | no | heishou-h3: hd / fast / raw / series |
resolution | no | video tier, e.g. 3MP 720p 768P |
seed | no | optional. Omit for random |
images / videos / audios | no | file id arrays. Or files: [{id, type}] |
curl https://asop.uk/api/v1/jobs \
-H "Authorization: Bearer $ASOP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "heishou-krea2",
"prompt": "Portrait still, wet neon alley, 2:3",
"aspect_ratio": "2:3",
"image_resolution": "6MP"
}'
GET /jobs/:id → queued | processing | completed | failed. GET /jobs/:id/content returns the signed URL (?redirect=1 to follow it).
POST /videos/generations
Same as POST /jobs, but the model must be reference-to-video. At least one image or video. Audio needs a visual.
| Model ID | Kind | Typical | Notes |
|---|---|---|---|
heishou-h3 | ref-video | 2:3 · 10s · 3MP / 1400p | HD 5–20s, FAST 5–30s, RAW 5–15s (768P/480P), SERIES 5–20s. h3Mode: hd / fast / raw / series. Image ≤9, video ≤3, audio ≤3. Overseas policy |
hongchao-h3 | ref-video | 10s · 768P | 5–15s. 480P / 768P / 2K / 4K. Stricter policy |
curl https://asop.uk/api/v1/videos/generations \
-H "Authorization: Bearer $ASOP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "heishou-h3",
"prompt": "Slow push-in, cinematic grain",
"duration": 10,
"aspect_ratio": "2:3",
"resolution": "3MP",
"images": ["file_YOUR_ID"]
}'
Errors
| HTTP | When |
|---|---|
| 401 | Missing or invalid token |
| 400 | Wrong model for the path, missing prompt/messages/files, bad params |
| 402 | Insufficient credits |
| 404 | Job or file not found |
| 409 | Job is not completed |
| 410 | Output expired |
| 502 | Generation failed (credits refunded) |
{"error":{"message":"Insufficient credits.","type":"invalid_request_error","code":402}}
Quick Start: /docs/getting-started/quick-start · Markdown: /docs/api-reference.md