API Reference
OpenAI-compatible relay for ASOP. Chat is synchronous. KREA2 and video use async jobs. GET /models lists currently available Create-page IDs. Do not call vendor-native paths on this host.
Relay contract
- Send a normal browser User-Agent. Default script UAs (Python-urllib, curl/8.x) are blocked by the site front door with `403 error 1010`, before auth is even checked.
- `completed` means the output exists — a job stays `processing` until the file is written, so `output` is never null on completion.
- `GET /jobs/{id}/content` waits up to ~5 s for a just-finished job; `409` carries `Retry-After`; `410` means the output has expired, so re-run.
- Send an `Idempotency-Key` UUID with `POST /jobs`. Repeating it within 24 h returns the same job instead of creating — and charging — a second one.
- `GET /models` returns `limits` (aspect ratios, per-mode durations, resolutions, max reference counts) and `defaults`. Read them; do not hardcode.
- Name files from `output.extension` / `output.content_type`, not from the response header. Always pass `aspect_ratio` for video.
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 returns a job (object image.generation.job) — poll GET /jobs/{id}.
FineView is exposed as three IDs — fineview-story (H3 Image: image_resolution 4MP/8MP/16MP, up to 12 references), fineview-v3 (4MP locked, up to 12 references, optional redqw21Hdr) and fineview-moss (fixed ≈2.36MP, exactly 1 reference). The ID fixes the production mode, so you do not pass redqw21Mode. All three need a positive credit balance and are the only models that accept 9:21. redqw21-unlocked stays callable by ID as the legacy alias (mode via redqw21Mode) but is not listed in GET /models.
| Field | Required | Notes |
|---|---|---|
model | no | default heishou-krea2; FineView: fineview-story / fineview-v3 / fineview-moss |
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; 9:21 only for redqw21-unlocked |
image_resolution | no | KREA2: 2K 6MP 12MP (default 6MP) · FineView: 4MP 8MP 16MP (default 8MP) |
krea2Mode | no | heishou-krea2: story / live / cute / snap |
redqw21Mode | no | legacy only (redqw21-unlocked): story (4/8/16MP, ≤12 refs) / v3 (4MP locked) / moss (≈2.36MP fixed, exactly 1 ref) |
redqw21Hdr | no | v3 only. Ignored for story and moss |
krea2HighRandom | no | heishou-krea2 only |
images | no | reference file ids |
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