sogrok API
API reference
Use a key to list models, quote, upload references, and create jobs. Each key only sees the models you allowed. Generating, checking the wallet, and uploading files need a signed-in session or a key.
1. Base URL and auth
Base URL:
https://sogrok.com
Prefix: /api/v1. JSON over HTTPS unless noted. Authorization: Bearer hxsk_....
| Item | Value |
|---|---|
| Auth | Authorization: Bearer hxsk_... |
| Quote TTL | 5 minutes, single use |
| Upload TTL | 24 hours |
| Prompt | 1–5000 characters |
Create keys on the keys page. The full key is shown once, starts with hxsk_, and is about 37 characters. Send the id from GET /api/v1/models, not the product label. Age confirmation is required before uploads or jobs.
2. Resources and status
| Object | Meaning |
|---|---|
| Model | Callable model. Use id in params.model. |
| SKU | Price tier. Video by resolution, image by quality, chat by context. |
| Quote | Priced offer bound to SKU, prompt, and params. |
| Job | One generation. Balance is held, then settled or refunded. On success, includes usage. |
| Upload | Reference file. Returns upload_id for params. |
| Wallet | Available and frozen USD. |
| status | Meaning |
|---|---|
| queued | Accepted, waiting |
| reserved / submitting / running | In progress |
| succeeded | Done, result available |
| failed | Failed, hold usually refunded |
| rejected | Moderation reject, not billed |
Success returns the business object. Errors are non-2xx with { "error": { "code": "...", "message": "..." } }. Job creation returns 202. Treat only 2xx bodies as success.
3. Operations
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/models | List models and tiers for this key |
| POST | /api/v1/quotes | Quote SKU + prompt + params |
| POST | /api/v1/jobs | Create a job with that quote |
| GET | /api/v1/jobs/:id | Poll one job |
| GET | /api/v1/jobs?job_id= | Search history, max 20 |
| GET | /api/v1/jobs/:id/media | Fetch output; ?thumb=1 for poster |
| POST | /api/v1/uploads | Upload a reference |
| GET | /api/v1/wallet | Balance and holds |
| POST | /v1/videos | Compat: one-shot video job |
| GET | /v1/videos/:id | Compat: poll a video job |
4. Models and SKUs
params.model must be an id below, or the current id from GET /api/v1/models. Do not send the keys-page label.
Video
| id | Name | Resolution | Duration | Modes |
|---|---|---|---|---|
| seedance-2-0-mini | seedance-2-0-mini | 480p / 720p | 4–15s, -1 adaptive | t2v / i2v / v2v |
| seedance-2-0-fast | seedance-2-0-fast | 480p / 720p | 4–15s, -1 adaptive | t2v / i2v / v2v |
| seedance-2-0 | seedance-2-0 | 480p / 720p / 1080p / 4K | 4–15s, -1 adaptive | t2v / i2v / v2v |
| seedance-2-5 | seedance-2-5 | 480p / 720p / 1080p | 4–30s, -1 adaptive | t2v / i2v / v2v |
| dreamina-seedance-2-0-mini-260615 | dreamina-seedance-2-0-mini-260615 | 480p / 720p | 4–15s, -1 adaptive | t2v / i2v / v2v |
| dreamina-seedance-2-0-fast-260128 | dreamina-seedance-2-0-fast-260128 | 480p / 720p | 4–15s, -1 adaptive | t2v / i2v / v2v |
| dreamina-seedance-2-0 | dreamina-seedance-2-0 | 480p / 720p / 1080p / 4K | 4–15s, -1 adaptive | t2v / i2v / v2v |
| dreamina-seedance-2-5 | dreamina-seedance-2-5 | 480p / 720p / 1080p | 4–30s, -1 adaptive | t2v / i2v / v2v |
| grok-imagine-video | Grok Imagine Video | 480p / 720p | 1–15s | t2v / i2v |
| grok-imagine-video-1.5 | Grok Imagine Video 1.5 | 480p / 720p / 1080p | 1–15s | t2v / i2v |
| wan-3.0 | Wan 3.0 | 480p / 720p / 1080p | 2–30s, -1 adaptive | t2v / i2v |
Image
| id | Name | Quality | Modes | Max stills |
|---|---|---|---|---|
| seedream | dola-seedream-5-0-pro-260628 | 1K / 1.5K / 2K | img / i2i / layer | 10 |
| seedream5 | seedream-5-0-260128 | 2K / 3K / 4K | img / i2i | 14 |
| seedream45 | Seedream 4.5 | 2K / 3K / 4K | img / i2i | 14 |
| grok-imagine-image | Grok Imagine Image | 1K / 2K | img | 3 |
| grok-imagine-image-2.0 | Grok Imagine Image 2.0 | 1K / 2K | img / i2i | 3 |
| grok-imagine-image-quality | Grok Imagine Image Quality | 1K / 2K | img / i2i | 3 |
| gpt-image-2 | GPT Image 2 | 1K / 2K / 4K | img / i2i | 16 |
| gpt-image-2.5-flare | GPT Image 2.5 Flare | 1K / 2K / 4K | img / i2i | 16 |
| gpt-image-2.5-sunburst | GPT Image 2.5 Sunburst | 1K / 2K / 4K | img / i2i | 16 |
| gpt-image-2.5-4k | GPT Image 2.5 | 4K | img / i2i | 16 |
| banana-pro | Banana Pro | 1K / 2K / 4K | img / i2i | 16 |
| banana-2.1 | Banana 2.1 | 1K / 2K / 4K | img / i2i | 16 |
| dola-seedream-5-0-flash-260915 | dola-seedream-5-0-flash-260915 | 1K / 1.5K / 2K | img / i2i | 10 |
Chat
| id | SKU | Notes |
|---|---|---|
| grok-4.5 | text.200k / text.500k | Billed by token |
| grok-4.6 | text.200k / text.500k | Billed by token |
| grok-4.7 | text.200k / text.500k | Billed by token |
SKU
| SKU | Maps to |
|---|---|
| video.fast | 480p |
| video.std | 720p |
| video.pro | 1080p |
| video.ultra | 4k |
| image.1k / image.15k / image.2k / image.3k / image.4k | 1K / 1.5K / 2K / 3K / 4K |
| text.200k / text.500k | Short / long context |
SKU must match resolution, e.g. 720p → video.std, 4k → video.ultra. The live list is GET /api/v1/models. Price is whatever the quote returns.
5. params
Quote and submit the same params object. Unknown fields return unsupported_field.
| Field | Type | Use |
|---|---|---|
| model | string | Model id, required |
| mode | string | t2v / i2v / v2v / img / i2i / layer / chat |
| ratio | string | Aspect ratio |
| resolution | string | Video 480p / 720p / 1080p / 4k; image 1K–4K |
| duration | integer | Video seconds. Seedance 2.x: -1 = adaptive (hold max, settle actual) |
| first_frame_upload_id | string | First frame |
| tail_frame_upload_id | string | Last frame, optional Seedance i2v |
| reference_image_upload_ids | string[] | Reference still upload ids |
| reference_image_urls | string[] | Public HTTPS stills |
| reference_video_upload_id | string | Reference clip, required for v2v (or use a URL) |
| reference_video_upload_ids | string[] | Multiple reference clips |
| reference_video_url | string | Public HTTPS reference clip |
| reference_video_urls | string[] | Multiple public HTTPS reference clips |
| reference_audio_upload_id | string | Reference audio; needs an image or video |
| reference_audio_upload_ids | string[] | Multiple reference audios |
| reference_audio_url | string | Public HTTPS reference audio |
| reference_audio_urls | string[] | Multiple public HTTPS reference audios |
| generate_audio | boolean | Generate audio |
| watermark | boolean | Watermark |
| clean_output | boolean | Clean output |
| negative | string | Negative prompt, max 1000 chars |
| seed | string | 1–12 digits |
| camera | string | fixed / push / pull / pan / truck / orbit / follow / crane |
| motion | integer | 1–8 |
| stylePreset | string | none / photo / cinematic / anime / render3d / guofeng / film |
| refStrength | number | Image-edit strength 0–1 |
| batch | integer | Image batch 1 / 2 / 4 |
| renderText | string | On-image text, max 120 chars |
| layer_count | integer | Layer count 1–17 |
| cfg | number | 1–15 |
| thinking | string | Thinking level off / standard / high (Banana image models only) |
Aspect ratios
| Family | ratio |
|---|---|
| Seedance | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
| Seedream | 1:1 / 4:3 / 3:4 / 16:9 / 9:16 / 3:2 / 2:3 / 21:9 |
| Grok image | 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 |
| Grok video | 16:9 / 4:3 / 3:2 / 1:1 / 2:3 / 3:4 / 9:16 |
Mode rules
i2vneeds a first frame or reference image.v2vneeds a reference video.- A video job with a first frame or still is image-to-video. First frame uses
first_frame_upload_id. Reference stills usereference_image_upload_ids. Do not mix the two. - Grok video accepts 1 still; Grok image accepts 3.
- Seedance 2.5: 30 images, 10 audio/video clips, 50 assets total. 2.0: 9 images, 3 audio/video clips, 15 total.
- Images, video and audio references accept either an
upload_idor a public HTTPS URL. Both can be mixed and count toward the same limits. URLs must be directly downloadable, up to 2048 characters; private-network and http addresses are rejected. - Reference audio is checked for copyright in the output audio; a task may be rejected when the material contains protected music. For reliable results, supply only visual references and let the model generate audio.
layeris seedream only: one still, billed by returned layers.
6. Endpoints
List models
GET /api/v1/models
curl https://sogrok.com/api/v1/models \ -H "Authorization: Bearer hxsk_..."
Returns { "object": "list", "data": [ ... ] }. Each item has id, modes, resolutions, and prices[].
Quote
POST /api/v1/quotes
curl https://sogrok.com/api/v1/quotes \
-H "Authorization: Bearer hxsk_..." \
-H "Content-Type: application/json" \
-d '{
"sku": "video.std",
"prompt": "slow push down a rainy alley, neon reflections",
"params": {
"model": "seedance-2-5",
"mode": "t2v",
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
}'Success fields: quote_id, price_usd, expires_at, estimated_time_seconds, params. Requote if prompt, SKU, or params change.
Create a job
POST /api/v1/jobs → 202
curl https://sogrok.com/api/v1/jobs \
-H "Authorization: Bearer hxsk_..." \
-H "Content-Type: application/json" \
-d '{
"quote_id": "PASTE_QUOTE_ID",
"sku": "video.std",
"prompt": "slow push down a rainy alley, neon reflections",
"params": {
"model": "seedance-2-5",
"mode": "t2v",
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
}'{
"job_id": "2f50c75e-...",
"status": "queued",
"quoted_price_usd": 0.45,
"created_at": "2026-09-09T08:00:00.000Z",
"queue": { "position": 1, "limit": 20 }
}Creation holds the quoted amount. Do not resubmit the same quote before you know the job status.
Poll a job
GET /api/v1/jobs/:id
curl https://sogrok.com/api/v1/jobs/JOB_ID \ -H "Authorization: Bearer hxsk_..."
Poll until succeeded / failed / rejected. Success includes result.url and usage. Image and video files use the site media URL; add ?thumb=1 for a poster. Chat text is in result.text. usage is { input_tokens, output_tokens, total_tokens } and is 0 until reported.
{
"job_id": "2f50c75e-...",
"sku": "video.std",
"model": "seedance-2-5",
"status": "succeeded",
"quoted_price_usd": 0.45,
"usage": {
"input_tokens": 0,
"output_tokens": 40594,
"total_tokens": 40594
},
"result": { "url": "https://sogrok.com/api/v1/jobs/JOB_ID/media" }
}curl "https://sogrok.com/api/v1/jobs/JOB_ID/media?thumb=1" \ -H "Authorization: Bearer hxsk_..." \ -o thumb.webp
History
curl "https://sogrok.com/api/v1/jobs?job_id=2f50" \ -H "Authorization: Bearer hxsk_..."
Max 20 rows. Filter by full or partial job id.
Upload a reference
POST /api/v1/uploads, multipart/form-data.
| slot | Type | Size |
|---|---|---|
| first / tail / ref | PNG / JPEG / WebP | 30 MB |
| video | MP4 / MOV | 50 MB |
| audio | MP3 / WAV | 15 MB |
curl https://sogrok.com/api/v1/uploads \ -H "Authorization: Bearer hxsk_..." \ -F slot=first \ -F [email protected]
Write the returned upload_id to first_frame_upload_id or reference_image_upload_ids. 10 uploads per user per minute.
Audio references (audio slot) are capped at 15 seconds per clip; longer uploads are rejected (400 audio_too_long).
{
"sku": "video.std",
"prompt": "the subject walks toward camera, outfit unchanged",
"params": {
"model": "seedance-2-5",
"mode": "i2v",
"resolution": "720p",
"ratio": "9:16",
"duration": 5,
"first_frame_upload_id": "UPLOAD_ID"
}
}Wallet
curl https://sogrok.com/api/v1/wallet \ -H "Authorization: Bearer hxsk_..."
Watch available_usd and frozen_usd. The quoted amount freezes on create and moves after settle or refund.
7. Compat video API
For clients that cannot quote then submit. Path is /v1/videos, not /api/v1. Same auth. The server fills SKU from resolution, quotes, and holds the balance. Use the full API for everything else.
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/videos | Create a video job |
| GET | /v1/videos/:id | Poll status and result |
curl https://sogrok.com/v1/videos \
-H "Authorization: Bearer hxsk_..." \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-5",
"prompt": "slow push down a rainy alley, neon reflections",
"duration": 10,
"resolution": "720p",
"ratio": "16:9",
"referenceImages": ["https://example.com/img.jpg"]
}'| Field | Required | Notes |
|---|---|---|
| model | yes | id from GET /api/v1/models, e.g. seedance-2-5 |
| prompt | yes | 1–5000 characters |
| duration | yes | Integer seconds. Seedance 2.x: -1 |
| resolution | yes | 480p / 720p / 1080p |
| ratio | yes | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
| referenceImages | no | Public HTTPS image URLs |
| referenceVideos | no | Public HTTPS video URLs |
| referenceAudios | no | Public HTTPS audio URLs |
status is queued / processing / succeeded / failed. The success url expires; download promptly. Local files still need /api/v1/uploads. Insufficient balance returns 400 and creates no job.
8. Integration flow
- Create a key and allow the models you need.
GET /api/v1/modelsto confirm id, modes, resolution, and SKU.- Upload references if required, keep
upload_id. POST /api/v1/quotesforquote_idandprice_usd.- Submit the same prompt, SKU, and params to
POST /api/v1/jobs. - Poll
GET /api/v1/jobs/:iduntil succeeded, failed, or rejected. - Download
result.url. Use?thumb=1for posters.
JOB_ID='...'
while true; do
STATUS=$(curl -sS "https://sogrok.com/api/v1/jobs/$JOB_ID" \
-H "Authorization: Bearer hxsk_..." \
| jq -r '.status')
echo "status=$STATUS"
case "$STATUS" in
succeeded|failed|rejected) break ;;
esac
sleep 3
done9. Error codes
| HTTP | code | Meaning |
|---|---|---|
| 400 | validation_error | Invalid request body |
| 400 | invalid_sku / invalid_model / invalid_mode | Model or SKU mismatch |
| 400 | unsupported_field | Field not allowed for this model or mode |
| 400 | missing_reference | Image-to-video or video-to-video missing a reference |
| 400 | audio_too_long | Reference audio longer than 15 seconds |
| 400 | quote_mismatch / invalid_quote / quote_expired | Quote expired or does not match |
| 400 | insufficient_balance / insufficient_quota | Wallet or key quota too low |
| 401 | unauthorized / invalid_api_key | Not signed in or key invalid |
| 403 | age_confirmation_required / model_not_allowed | Age gate or model not allowed on this key |
| 404 | job_not_found | Job missing or not owned by this account |
| 409 | quote_already_used / wallet_busy | Quote already used, or retry |
| 429 | queue_full / rate_limited | Queue full or upload too fast; no extra hold |
| 503 | generation_unavailable | Generation unavailable; nothing reserved |
Moderation rejects are not billed. If submit times out, the hold stays — poll the job instead of resubmitting the same quote.