Repository navigation
Description
Summary
Please add a record/replay provider for BytePlus Ark (ByteDance's overseas ModelArk platform; the same API shape as Volcengine Ark in China). It serves the Seedance video models (Seedance 2.0 / 2.5 / Mini), Seedream image models and Doubao chat. Today aimock has no handler for its async video job API, so any app that talks to Ark natively has to bypass aimock entirely — live, billable and unrecorded — while the same models on fal.ai record fine through the built-in fal handler.
What Ark looks like on the wire
Data plane base URL: https://ark.ap-southeast.bytepluses.com/api/v3 (also ark.eu-west.bytepluses.com). Auth: Authorization: Bearer <ARK_API_KEY>. Three surfaces matter:
- Video generation (async job) — not OpenAI-shaped, closest to the OpenRouter / Grok job lifecycles aimock already models:
POST /api/v3/contents/generations/taskswith{ model, content: [ {type:'text', text}, {type:'image_url', image_url:{url}, role?: 'first_frame' | 'reference_image'} … ] }→{ id }GET /api/v3/contents/generations/tasks/{id}→{ id, status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'expired', content?: { video_url }, usage?: { completion_tokens }, error?: { code, message } }- Billing is reported in tokens on the terminal poll, so a fixture needs a place to carry
usage.
- Image generation —
POST /api/v3/images/generations, OpenAI-compatible request/response ({ model, prompt, size, watermark, response_format }→{ data: [ { url | b64_json } ], usage }). This one may already work through the genericopenaiimages handler if the upstream is set to Ark; abyteplusprovider key would just make the routing explicit. - Chat —
POST /api/v3/chat/completions, OpenAI-compatible; same story as (2).
There is a separate control plane (the Assets OpenAPI at ark.ap-southeast-1.byteplusapi.com, ?Action=CreateAsset|GetAsset|ListAssets|DeleteAsset) signed with HMAC-SHA256 IAM credentials rather than a bearer token. That is used to register stills as asset:// ids before a video job when the input contains a real face. I'd treat it as out of scope for a first cut: it is signed, so it falls into the same bucket as Bedrock SigV4 / Vertex OAuth in your providerKeys docs.
Ask
- A
byteplus(orark) entry inRecordProviderKeywith a handler for/contents/generations/tasks+/contents/generations/tasks/{id}that records the submit and proxies polls until a terminal status, then mutates into a replay job — the patterngrok-video.tsandopenrouter-video.tsalready implement. - Fixture shape reusing
VideoResponse["video"](status, url, error) plususage.completion_tokens. - Route
/api/v3/images/generationsand/api/v3/chat/completionsthrough the existing OpenAI-compatible handlers under that provider, so one upstream config covers all three.
Context
We use @tanstack/ai-byteplus against Ark and @copilotkit/aimock 1.39 for Playwright record/replay (OpenRouter + fal today, native xAI via a second instance). Docs: https://docs.byteplus.com/en/docs/ModelArk/1520757 (video generation API). Happy to test a branch against real Ark keys.
Activity
jpr5 commentedon Sep 10, 2026
Built it — #424. The wire shape came from your
@tanstack/ai-bytepluswire-types.ts, since BytePlus's docs are client-rendered SPAs that fetch down to nav chrome and nothing else.One thing we can't close on our own. The drift canary assumes Ark answers an unknown task id with a 404 carrying a dotted error code, and nobody has ever checked that against the live API. We tried to get our own key: ModelArk isn't available in the US — their own availability list has ~180 countries and we're not one of them.
You mentioned you could test against real keys. Two ways, whichever suits you:
GET /api/v3/contents/generations/tasks/{id}, never generates anything. Send it however you prefer, not here.curl -ithat endpoint with a task id that doesn't exist. Status, headers and body is all we need.Either settles it. The keyless auth-envelope probe already runs, so this is the last unverified assumption in the leg.
Ideally though, a key. I use them for the automated drift checks.
feat(byteplus): record/replay BytePlus Ark (Seedance) video task life…
feat(byteplus): record/replay BytePlus Ark (Seedance) video task life…