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.

Loading live quotes…

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.

FieldRequiredNotes
modelyesprompt-assist only
messagesyesOpenAI message array. Vision: user content may be an array with text and image_url
streamnoSSE when true
max_tokensno16–4096, default 1024
temperaturenodefault 0.7
top_pnooptional
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}.

FieldRequiredNotes
modelnodefault heishou-krea2. Also redqw21-unlocked / qwenimage2.1
promptyesmax 8000 chars
sizenoWxH such as 1024x1536, or a resolution tier
aspect_rationo2:3 3:2 3:4 4:3 1:1 16:9 9:16 21:9
image_resolutionnoKREA2: 2K 6MP 12MP (default 6MP). REDQW21: 1.5MP 4MP 8MP
krea2Modenoheishou-krea2: story / live / cute
imageGenModenoredqw21-unlocked: txt2img / edit / ref
redqw21PromptEnhancenodefault true
imagesnoreference file ids for edit/ref
negative_promptnooptional
seednooptional. Omit for random
nnomust 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.

FieldRequiredNotes
fileyesmultipart field, or raw body with X-Filename
purposenodefault 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.

FieldRequiredNotes
modelyesany image or video ID
promptyesmax 8000 chars
aspect_rationoH3 default 2:3; other video default 9:16
image_resolutionnoimage models only
durationnovideo seconds (clamped to the model range)
h3Modenoheishou-h3: hd / fast / raw / series
resolutionnovideo tier, e.g. 3MP 720p 768P
seednooptional. Omit for random
images / videos / audiosnofile 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 IDKindTypicalNotes
heishou-h3ref-video2:3 · 10s · 3MP / 1400pHD 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-h3ref-video10s · 768P5–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

HTTPWhen
401Missing or invalid token
400Wrong model for the path, missing prompt/messages/files, bad params
402Insufficient credits
404Job or file not found
409Job is not completed
410Output expired
502Generation 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