A Next.js App Router playground for testing official-compatible BYOK media generation APIs.
This app runs in BYOK (Bring Your Own Key) mode:
- No Google/NextAuth login.
- No Stripe checkout or app-managed credits.
- The browser stores API URLs and API keys in local storage.
- Requests send the selected API URL through
x-api-url. - Requests send the key through
x-api-keyorAuthorization: Bearer <key>. - The server forwards provider credentials per request and does not store API keys.
/: Seedance 2.0 video task tester./images: image tester for Tokensea Gemini/Lovart and OpenAI-compatible image APIs./creations: public archive of saved Seedance video task records.
The Seedance tester defaults to the Volcengine Ark official video generation task endpoint:
https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks
The image tester defaults to the Tokensea OpenAI Images-compatible endpoint:
https://agent.tokensea.ai/v1/images/generations
This default uses the OpenAI Images payload shape with model gpt-image-2 and does not add response_format, matching the current gateway behavior where GPT image models default to b64_json. A Tokensea Gemini/Lovart generateContent preset remains available for Gemini-style payload checks:
https://agent.tokensea.ai/v1/models/gemini-3.1-flash-image:generateContent
The official OpenAI image preset uses:
https://api.openai.com/v1/images/generations
Both defaults can be replaced in the UI when testing another official-compatible gateway.
All proxy routes require:
x-api-url: upstream provider endpoint.x-api-keyorAuthorization: Bearer <key>: provider API key.x-auth-mode: upstream auth header mode, one ofbearer,api-key, orboth. Defaults tobearer.
Video task submission:
- App route:
POST /api/seedance - Body:
{ "payload": { ... }, "metadata": { ... } } - Upstream request:
POST <x-api-url>
Video task status polling:
- App route:
POST /api/seedance/check-status - Body:
{ "requestId": "..." } - Upstream request:
GET <x-api-url>/<requestId>
Image generation:
- App route:
POST /api/image - Body:
{ "payload": { ... } } - Upstream request:
POST <x-api-url>
Archive:
- App route:
GET /api/creations - Returns up to 100 saved
Creationrecords ordered by newest first.
The Seedance page supports:
- Volcengine official
contentpayloads. - Raw JSON payload override.
The image page supports:
- OpenAI-compatible image fields such as
model,prompt,size,quality,background,output_format,output_compression,moderation,n,stream,partial_images, anduser. - Tokensea Gemini/Lovart
generateContentpayloads for text-to-image,generationConfig.imageConfigaspect/size requests, inline image editing, multi-image references, and hostedfile_datareferences. - Raw JSON payload override for exact provider compatibility checks.
Seedance submissions with a task id are saved to PostgreSQL through Prisma. The Creation model stores prompt metadata, media inputs, task status, request id, output URL, and error details.
Image generations are returned directly from /api/image and are not saved to the archive.
| Service | Variable | Description |
|---|---|---|
| Database | DATABASE_URL |
PostgreSQL connection string used by Prisma. |
npm install
npx prisma generate
npx prisma db push
npm run devOpen http://localhost:3000, select a tester, enter your API URL and API key, then submit a request.
npm run dev: start the Next.js dev server.npm test: run Node regression tests.npm run lint: run ESLint.npm run build: generate Prisma client and build the Next.js app.
- The app is focused on API coverage testing, not account management or billing.
- Local file upload is not wired to a fixed provider endpoint in this BYOK build. Use hosted image, video, and audio URLs in the form.
- The Prisma schema no longer includes NextAuth user/session/account tables.