useapi.net — Experimental API for AI services. $15/month subscription gives full access to all APIs listed below. Subscribe: https://useapi.net/docs/subscription Support: https://discord.gg/w28uK3cnmF | https://t.me/use_api === URL: https://useapi.net/docs/start-here/setup-dreamina === Document URL: https://useapi.net/docs/start-here/setup-dreamina --- layout: default title: Setup Dreamina parent: Start Here nav_order: 206 --- # Dreamina {: .no_toc } February 23, 2026 (March 4, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} Approximately 10 minutes to complete setup steps. --- {: .note } > This is the setup guide for [Dreamina API](../api-dreamina-v1). An active [Dreamina](https://dreamina.capcut.com/) subscription and a [useapi.net subscription](../subscription) are required for the API to work. [Dreamina](https://dreamina.capcut.com/) creates AI-generated videos and images using models from [ByteDance's Seed](https://seed.bytedance.com/) family. Video models: [Seedance 2.0](https://dreamina.capcut.com/), [Seedance 1.5 Pro](https://dreamina.capcut.com/), and [Seedance 1.0 Mini](https://dreamina.capcut.com/). Image models: [Seedream 5.0 Lite](https://dreamina.capcut.com/), [Seedream 4.6](https://dreamina.capcut.com/), [Seedream 4.5](https://dreamina.capcut.com/), [Seedream 4.1](https://dreamina.capcut.com/), [Seedream 4.0](https://dreamina.capcut.com/), [Nano Banana](https://dreamina.capcut.com/), and [Seedream 3.0](https://dreamina.capcut.com/). This setup guide is specifically for **US/International** accounts. Dreamina requires a US-region IP address to access the international version of the service. ### Install Opera browser with VPN [Opera](https://www.opera.com/) browser has a built-in free VPN which is required to create and access a Dreamina account from the US/International region. 1. Download and install [Opera](https://www.opera.com/) if you don't have it already 2. Enable the built-in VPN by clicking the **VPN** badge in the address bar 3. Set the VPN region to **Americas** 4. Verify the VPN is active — you should see "Protected" and an Americas IP address ![](../../assets/images/setup-dreamina-1.jpg) ### Create a Dreamina account ⚠️ **Use a dedicated email account for this API — do NOT use your personal email.** 1. Navigate to [https://dreamina.capcut.com/](https://dreamina.capcut.com/) in Opera with VPN enabled 2. Click **Sign in** in the bottom-left corner 3. Select **Continue with email** from the login options ![](../../assets/images/setup-dreamina-2.jpg) 4. Click **Sign up** to create a new account 5. Enter your **email address** and choose a **password** 6. Click **Continue** to complete registration ![](../../assets/images/setup-dreamina-3.jpg) You may need to verify your email address by entering a code sent to your inbox. ### Verify and add account Use the form below to verify your credentials and add your Dreamina account. Select **Add Account** to complete setup, or **Verify** to test your credentials first. You should receive response `200` if successful. You can also use [POST /accounts](../api-dreamina-v1/post-dreamina-accounts) directly.
### Generate your first video Once your account is configured, generate a video using [POST /videos](../api-dreamina-v1/post-dreamina-videos): ```bash curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Two cool cats walking and talking", "model": "seedance-2.0", "ratio": "16:9", "duration": 5 }' \ "https://api.useapi.net/v1/dreamina/videos" ``` This returns a `jobid` immediately. Poll for completion using [GET /videos/`jobid`](../api-dreamina-v1/get-dreamina-videos-jobid): ```bash curl -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/videos/YOUR_JOB_ID" ``` When `status` changes to `completed`, the `response.videoUrl` field contains the direct video download URL. You can also see the generated video in the Dreamina web interface: ![](../../assets/images/setup-dreamina-4.jpg) ### Pricing [Dreamina Advanced](https://dreamina.capcut.com/) subscription ($40/mo or $335/yr) includes 30K credits per month. A single 12-second Seedance 2.0 generation costs 72 credits — approximately **$0.095/generation** on the monthly plan or under **$0.07/generation** on the yearly plan. Every account also receives 2 free generations per day. Both plans include free and unlimited Seedream 4.0 image generation, including 2K resolution. ### Important notes - **VPN not required for API usage** — the VPN is only needed for creating the Dreamina account in the browser. The API handles all requests through its own proxy infrastructure. - **Session management** — the API automatically manages your Dreamina session, including refreshing expired sessions. If you see `596` errors, re-add your account via [POST /accounts](../api-dreamina-v1/post-dreamina-accounts). - **Avoid using the same account** simultaneously through both the API and the Dreamina website — it should work, but to play safe it's better to avoid potential session conflicts. - **Avoid logging in from other regions** — do not log in to your Dreamina account from any region other than Americas, as it may change the account's default region. - **Free credits** — new Dreamina accounts receive free credits. Check your balance via [GET /accounts/`account`](../api-dreamina-v1/get-dreamina-accounts-account). === URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-accounts-account === Document URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-accounts-account --- layout: default title: DELETE accounts/account parent: Dreamina API v1 nav_order: 400 --- ## Delete Account Configuration {: .no_toc } February 23, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Delete a configured Dreamina account. This removes the account from your configuration and cleans up any executing job entries. **Warning:** This action cannot be undone. You will need to reconfigure the account using [POST /accounts](https://useapi.net/docs/api-dreamina-v1/post-dreamina-accounts) if you want to use it again. {: .delete } > **https://api.useapi.net/v1/dreamina/accounts/`account`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `account` is **required**. ### Responses {% tabs v1_delete_dreamina_accounts_response %} {% tab v1_delete_dreamina_accounts_response 200 %} 200 OK Account deleted successfully. ```json { "account": "US:user@example.com", "deleted": true, "remaining": 0 } ``` - `remaining` - Number of other accounts still configured. {% endtab %} {% tab v1_delete_dreamina_accounts_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_delete_dreamina_accounts_response 404 %} 404 Not Found Account not found or not configured. ```json { "error": "Unable to find configuration for account US:user@example.com" } ``` {% endtab %} {% endtabs %} ### Examples {% tabs v1_delete_dreamina_accounts_example %} {% tab v1_delete_dreamina_accounts_example Curl %} ``` bash curl -X DELETE \ -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/accounts/US:user@example.com" ``` {% endtab %} {% tab v1_delete_dreamina_accounts_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const account = 'US:user@example.com'; const response = await fetch( `https://api.useapi.net/v1/dreamina/accounts/${encodeURIComponent(account)}`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } } ); const result = await response.json(); console.log('Delete result:', result); ``` {% endtab %} {% tab v1_delete_dreamina_accounts_example Python %} ``` python import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' account = 'US:user@example.com' headers = {'Authorization': f'Bearer {token}'} response = requests.delete( f'https://api.useapi.net/v1/dreamina/accounts/{quote(account, safe="")}', headers=headers ) print('Delete result:', response.json()) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-assets-assetid === Document URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-assets-assetid --- layout: default title: DELETE assets/assetId parent: Dreamina API v1 nav_order: 520 --- ## Delete Asset {: .no_toc } March 2, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Delete a specific asset (image or video) from generation history. The `assetId` is obtained from [GET /assets/`account`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-assets-account), completed [GET /images/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid), or [GET /videos/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-videos-jobid) results. {: .delete } > **https://api.useapi.net/v1/dreamina/assets/`assetId`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `assetId` is **required**. ### Responses {% tabs v1_delete_dreamina_assets_assetid_response %} {% tab v1_delete_dreamina_assets_assetid_response 200 %} 200 OK Asset deleted successfully. ```json { "deleted": true, "assetId": "US:user@example.com-306191111942:7612453183683579150", "account": "US:user@example.com" } ``` {% endtab %} {% tab v1_delete_dreamina_assets_assetid_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_delete_dreamina_assets_assetid_response 404 %} 404 Not Found Account not found or not configured. ```json { "error": "Unable to find configuration for account US:user@example.com" } ``` {% endtab %} {% endtabs %} ### Examples {% tabs v1_delete_dreamina_assets_assetid_example %} {% tab v1_delete_dreamina_assets_assetid_example Curl %} ``` bash curl -X DELETE \ -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/assets/US:user@example.com-306191111942:7612453183683579150" ``` {% endtab %} {% tab v1_delete_dreamina_assets_assetid_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const assetId = 'US:user@example.com-306191111942:7612453183683579150'; const response = await fetch( `https://api.useapi.net/v1/dreamina/assets/${encodeURIComponent(assetId)}`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } } ); const result = await response.json(); console.log('Delete result:', result); ``` {% endtab %} {% tab v1_delete_dreamina_assets_assetid_example Python %} ``` python import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' asset_id = 'US:user@example.com-306191111942:7612453183683579150' response = requests.delete( f'https://api.useapi.net/v1/dreamina/assets/{quote(asset_id, safe="")}', headers={'Authorization': f'Bearer {token}'} ) print('Delete result:', response.json()) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-scheduler-jobid === Document URL: https://useapi.net/docs/api-dreamina-v1/delete-dreamina-scheduler-jobid --- layout: default title: DELETE scheduler/jobid parent: Dreamina API v1 nav_order: 810 --- ## Cancel Executing Job {: .no_toc } February 23, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Remove a job from the executing tracker and cancel it. If the job is still in `created` status, it will be marked as failed with the reason "Cancelled by user". {: .delete } > **https://api.useapi.net/v1/dreamina/scheduler/`jobid`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `jobid` is **required**. The job ID to remove from the scheduler. ### Responses {% tabs v1_delete_dreamina_scheduler_response %} {% tab v1_delete_dreamina_scheduler_response 200 %} 200 OK Job removed from scheduler. ```json { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "removed": true } ``` {% endtab %} {% tab v1_delete_dreamina_scheduler_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_delete_dreamina_scheduler_response 404 %} 404 Not Found Job belongs to a different user. {% endtab %} {% endtabs %} ### Examples {% tabs v1_delete_dreamina_scheduler_example %} {% tab v1_delete_dreamina_scheduler_example Curl %} ``` bash curl -X DELETE \ -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/scheduler/j0223140530123456789v-u12345-US:user@example.com-bot:dreamina" ``` {% endtab %} {% tab v1_delete_dreamina_scheduler_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const jobid = 'j0223140530123456789v-u12345-US:user@example.com-bot:dreamina'; const response = await fetch( `https://api.useapi.net/v1/dreamina/scheduler/${jobid}`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } } ); const result = await response.json(); console.log('Cancel result:', result); ``` {% endtab %} {% tab v1_delete_dreamina_scheduler_example Python %} ``` python import requests token = 'YOUR_API_TOKEN' jobid = 'j0223140530123456789v-u12345-US:user@example.com-bot:dreamina' headers = {'Authorization': f'Bearer {token}'} response = requests.delete( f'https://api.useapi.net/v1/dreamina/scheduler/{jobid}', headers=headers ) print('Cancel result:', response.json()) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-accounts-account === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-accounts-account --- layout: default title: GET accounts/account parent: Dreamina API v1 nav_order: 350 --- ## Get Account Configuration {: .no_toc } February 23, 2026 (March 2, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Get configuration details for a specific Dreamina account, including session status, available models, and credit balance. Can also be called once a day to claim free daily credits. {: .get } > **https://api.useapi.net/v1/dreamina/accounts/`account`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `account` is **required**. ### Responses {% tabs v1_get_dreamina_accounts_account_response %} {% tab v1_get_dreamina_accounts_account_response 200 %} 200 OK Account details retrieved with live data from upstream. ```json { "account": "US:user@example.com", "email": "user@example.com", "region": "US", "maxJobs": 10, "sessionExpires": "2026-04-24T12:00:00.000Z", "session": { "expires": "2026-04-24T12:00:00.000Z", "lastRefreshed": "2026-02-23T12:00:00.000Z", "daysUntilExpiry": 60 }, "models": { "video": ["seedance-2.0", "seedance-1.5-pro", "seedance-1.0-mini"], "image": ["seedream-4.5", "seedream-4.1", "seedream-4.0", "nano-banana", "seedream-3.0"] }, "credits": { "total": 24065, "vip": 12000, "gift": 10065, "purchase": 2000, "dailyClaimed": true } } ``` **Note:** The `models`, `credits`, and `session` fields are fetched live from upstream. If upstream queries fail, a summary without these fields is returned. {% endtab %} {% tab v1_get_dreamina_accounts_account_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_get_dreamina_accounts_account_response 404 %} 404 Not Found Account not found or not configured. ```json { "error": "Unable to find configuration for account US:user@example.com" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { account: string // "US:user@example.com" email: string region: string // "US" maxJobs: number // 1-50 sessionExpires: string // ISO 8601 timestamp session?: { expires: string // ISO 8601 timestamp lastRefreshed: string // ISO 8601 timestamp daysUntilExpiry: number } models?: { video: string[] // Available video model names image: string[] // Available image model names } credits?: { total: number vip: number gift: number purchase: number dailyClaimed: boolean } error?: string // Error message } ``` ### Examples {% tabs v1_get_dreamina_accounts_account_example %} {% tab v1_get_dreamina_accounts_account_example Curl %} ``` bash curl -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/accounts/US:user@example.com" ``` {% endtab %} {% tab v1_get_dreamina_accounts_account_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const account = 'US:user@example.com'; const response = await fetch( `https://api.useapi.net/v1/dreamina/accounts/${encodeURIComponent(account)}`, { headers: { 'Authorization': `Bearer ${token}` } } ); const accountConfig = await response.json(); console.log('Account:', accountConfig); console.log('Credits:', accountConfig.credits); console.log('Models:', accountConfig.models); ``` {% endtab %} {% tab v1_get_dreamina_accounts_account_example Python %} ``` python import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' account = 'US:user@example.com' headers = {'Authorization': f'Bearer {token}'} response = requests.get( f'https://api.useapi.net/v1/dreamina/accounts/{quote(account, safe="")}', headers=headers ) account_config = response.json() print('Account:', account_config) print('Credits:', account_config.get('credits')) print('Models:', account_config.get('models')) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-accounts === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-accounts --- layout: default title: GET accounts parent: Dreamina API v1 nav_order: 300 --- ## List All Configured Accounts {: .no_toc } February 23, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- List all configured Dreamina accounts. To get a specific account with live details use [GET /accounts/`account`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-accounts-account). {: .get } > **https://api.useapi.net/v1/dreamina/accounts** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Responses {% tabs v1_get_dreamina_accounts_response %} {% tab v1_get_dreamina_accounts_response 200 %} 200 OK Returns a map of all configured accounts, keyed by account identifier. ```json { "US:user@example.com": { "account": "US:user@example.com", "email": "user@example.com", "region": "US", "maxJobs": 10, "sessionExpires": "2026-04-24T12:00:00.000Z" } } ``` If no accounts are configured, returns an empty object `{}`. {% endtab %} {% tab v1_get_dreamina_accounts_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% endtabs %} ### Model ```typescript // Map of account identifier to account summary { [account: string]: { account: string // "US:user@example.com" email: string region: string // "US" maxJobs: number sessionExpires: string // ISO 8601 timestamp error?: string // Error message if account has issues } } ``` ### Examples {% tabs v1_get_dreamina_accounts_example %} {% tab v1_get_dreamina_accounts_example Curl %} ``` bash curl -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/accounts" ``` {% endtab %} {% tab v1_get_dreamina_accounts_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const response = await fetch('https://api.useapi.net/v1/dreamina/accounts', { headers: { 'Authorization': `Bearer ${token}` } }); const accounts = await response.json(); console.log('Configured accounts:', accounts); ``` {% endtab %} {% tab v1_get_dreamina_accounts_example Python %} ``` python import requests token = 'YOUR_API_TOKEN' headers = {'Authorization': f'Bearer {token}'} response = requests.get('https://api.useapi.net/v1/dreamina/accounts', headers=headers) print('All accounts:', response.json()) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-assets-account === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-assets-account --- layout: default title: GET assets/account parent: Dreamina API v1 nav_order: 510 --- ## List Generation History {: .no_toc } March 2, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- List generation history (images and videos) for a specific account. Returns assets with their URLs, dimensions, and reusable `assetRef` values for [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) or as in [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos). {: .get } > **https://api.useapi.net/v1/dreamina/assets/`account`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `account` is **required**. ### Query Parameters - `count` is optional. Number of assets to return (1-100, default: `20`). - `offset` is optional. Pagination cursor from a previous response's `nextOffset`. ### Responses {% tabs v1_get_dreamina_assets_account_response %} {% tab v1_get_dreamina_assets_account_response 200 %} 200 OK Returns generation history with asset details. ```json { "assets": [ { "assetId": "US:user@example.com-306191111942:7612453183683579150", "historyRecordId": "306191111942", "itemId": "7612453183683579150", "type": "image", "coverUrl": "https://p9-sign.douyinpic.com/...", "description": "A stunning aurora borealis over a frozen lake", "assetRef": "US:user@example.com-image:w2560:h1440:s905000-uri:tos-useast5-i-wopfjsm1ax-tx/abc123", "imageUrl": "https://p9-sign.douyinpic.com/...", "width": 2560, "height": 1440, "format": "webp", "createdAt": "2026-03-02T14:06:06.000Z" }, { "assetId": "US:user@example.com-306191137798:7612453244173880589", "historyRecordId": "306191137798", "itemId": "7612453244173880589", "type": "video", "coverUrl": "https://p9-sign.douyinpic.com/...", "description": "A cinematic drone shot", "videoUrl": "https://v16m-default.akamaized.net/...", "width": 1280, "height": 720, "createdAt": "2026-03-02T14:08:07.000Z" } ], "hasMore": true, "nextOffset": 20, "account": "US:user@example.com" } ``` - `assetRef` on image assets can be used directly as `imageRef_N` in [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) or as `firstFrameRef` in [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos). - `assetId` can be used with [DELETE /assets/`assetId`](https://useapi.net/docs/api-dreamina-v1/delete-dreamina-assets-assetid) to remove an asset. - Videos do not have `assetRef` — only a `videoUrl` for download. {% endtab %} {% tab v1_get_dreamina_assets_account_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_get_dreamina_assets_account_response 404 %} 404 Not Found Account not found or not configured. ```json { "error": "Unable to find configuration for account US:user@example.com" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { assets: Array<{ assetId: string // ID for DELETE /assets/ historyRecordId: string itemId: string type: 'image' | 'video' coverUrl?: string // Thumbnail URL description?: string // Generation prompt assetRef?: string // Reusable ref (images only) imageUrl?: string // Full image URL (images only) videoUrl?: string // Video URL (videos only) width?: number height?: number format?: string // Image format (images only) createdAt?: string // ISO 8601 timestamp }> hasMore: boolean // More pages available nextOffset: number // Pass as offset for next page account: string } ``` ### Examples {% tabs v1_get_dreamina_assets_account_example %} {% tab v1_get_dreamina_assets_account_example Curl %} ``` bash curl -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/assets/US:user@example.com?count=10" ``` {% endtab %} {% tab v1_get_dreamina_assets_account_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const account = 'US:user@example.com'; const response = await fetch( `https://api.useapi.net/v1/dreamina/assets/${encodeURIComponent(account)}?count=20`, { headers: { 'Authorization': `Bearer ${token}` } } ); const result = await response.json(); console.log(`Assets: ${result.assets.length}, hasMore: ${result.hasMore}`); result.assets.forEach(a => { console.log(` ${a.type} ${a.assetId} ${a.width}x${a.height}`); if (a.assetRef) console.log(` assetRef: ${a.assetRef}`); }); ``` {% endtab %} {% tab v1_get_dreamina_assets_account_example Python %} ``` python import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' account = 'US:user@example.com' response = requests.get( f'https://api.useapi.net/v1/dreamina/assets/{quote(account, safe="")}', headers={'Authorization': f'Bearer {token}'}, params={'count': 20} ) result = response.json() print(f"Assets: {len(result['assets'])}, hasMore: {result['hasMore']}") for a in result['assets']: print(f" {a['type']} {a['assetId']} {a.get('width')}x{a.get('height')}") ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid --- layout: default title: GET images/jobid parent: Dreamina API v1 nav_order: 720 --- ## Retrieve Image Job Status {: .no_toc } March 2, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Retrieve the status and result of an image generation or upscale job by its job ID. Use this endpoint to poll for completion after submitting an image via [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) or [POST /images/upscale](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images-upscale). Jobs are retained for 30 days. {: .get } > **https://api.useapi.net/v1/dreamina/images/`jobid`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `jobid` is **required**, the unique job identifier returned from [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) or [POST /images/upscale](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images-upscale). ### Responses {% tabs v1_get_dreamina_images_jobid_response %} {% tab v1_get_dreamina_images_jobid_response 200 %} 200 OK Returns the job record with current status and details. **Processing (status: created):** ```json { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "type": "image", "status": "created", "model": "seedream-4.0", "created": "2026-03-02T14:05:30.123Z", "request": { "prompt": "A stunning aurora borealis over a frozen lake", "model": "seedream-4.0", "ratio": "16:9", "resolution": "2k", "inputMode": "generate" }, "response": { "forecastCost": 0 }, "code": 200 } ``` **Completed (image generation):** ```json { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "type": "image", "status": "completed", "model": "seedream-4.0", "created": "2026-03-02T14:05:30.123Z", "updated": "2026-03-02T14:06:06.789Z", "request": { "prompt": "A stunning aurora borealis over a frozen lake", "model": "seedream-4.0", "ratio": "16:9", "resolution": "2k", "inputMode": "generate" }, "response": { "images": [ { "imageUrl": "https://p9-sign.douyinpic.com/...", "imageUri": "tos-useast5-i-wopfjsm1ax-tx/abc123", "width": 2560, "height": 1440, "format": "jpeg", "assetId": "US:user@example.com-306191111942:7612453183683579150", "assetRef": "US:user@example.com-image:w2560:h1440:s905000-uri:tos-useast5-i-wopfjsm1ax-tx/abc123", "itemId": "7612453183683579150" }, { "imageUrl": "https://p9-sign.douyinpic.com/...", "imageUri": "tos-useast5-i-wopfjsm1ax-tx/def456", "width": 2560, "height": 1440, "format": "jpeg", "assetId": "US:user@example.com-306191111942:7612453183683595534", "assetRef": "US:user@example.com-image:w2560:h1440:s911000-uri:tos-useast5-i-wopfjsm1ax-tx/def456", "itemId": "7612453183683595534" } ], "forecastCost": 0, "historyRecordId": "306191111942", "finishTime": 1709391966 }, "code": 200 } ``` **Completed (upscale):** ```json { "jobid": "j0302140630123456789I-u12345-US:user@example.com-bot:dreamina", "type": "upscale", "status": "completed", "model": "seedream-4.0", "created": "2026-03-02T14:06:30.123Z", "updated": "2026-03-02T14:08:07.456Z", "request": { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "imageIndex": 0, "resolution": "4k" }, "response": { "images": [ { "imageUrl": "https://p9-sign.douyinpic.com/...", "imageUri": "tos-useast5-i-wopfjsm1ax-tx/upscaled123", "width": 4096, "height": 4096, "format": "jpeg", "assetId": "US:user@example.com-306191137798:7612453244173880589", "assetRef": "US:user@example.com-image:w4096:h4096:s1482000-uri:tos-useast5-i-wopfjsm1ax-tx/upscaled123", "itemId": "7612453244173880589" } ], "forecastCost": 0, "historyRecordId": "306191137798", "finishTime": 1709392087 }, "code": 200 } ``` **Note:** The `assetRef` on each image can be used directly as `imageRef_N` in [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) for further generations, without needing to re-upload. **Failed:** ```json { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "type": "image", "status": "failed", "model": "seedream-4.0", "created": "2026-03-02T14:05:30.123Z", "updated": "2026-03-02T14:07:15.456Z", "request": { "prompt": "A test prompt", "model": "seedream-4.0", "ratio": "16:9", "resolution": "2k", "inputMode": "generate" }, "error": "fail_code: 2038", "errorDetails": "ContentFiltered", "code": 2038 } ``` **Note:** Jobs older than 1 hour that are still `created` are auto-marked as failed with `"Generation timed out"` (code `408`). {% endtab %} {% tab v1_get_dreamina_images_jobid_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_get_dreamina_images_jobid_response 404 %} 404 Not Found Job not found, belongs to a different user, or has expired (>30 days). ```json { "error": "Job not found" } ``` {% endtab %} {% endtabs %} ### Model {% tabs v1_get_dreamina_images_jobid_model %} {% tab v1_get_dreamina_images_jobid_model Completed %} Image generation completed. Includes image URLs and metadata. ```typescript { jobid: string // Unique job identifier type: 'image' | 'upscale' // Job type status: 'completed' model: string // Model used created: string // ISO 8601 timestamp updated: string // ISO 8601 timestamp request: { prompt?: string model?: string ratio?: string resolution?: string inputMode?: string // Auto-detected from params imageRef_1?: string // Reference image assetRef (when provided) imageRef_2?: string imageRef_3?: string jobid?: string // Source job (upscale only) imageIndex?: number // Source image index (upscale only) replyUrl?: string replyRef?: string } response: { images: Array<{ imageUrl: string // Direct image URL (JPEG) imageUri: string // Native URI width: number // Image width in pixels height: number // Image height in pixels format: string // "jpeg" assetId: string // Asset identifier assetRef: string // Can be used as imageRef_N in POST /images itemId: string // Upstream item ID }> forecastCost: number // Credit cost historyRecordId: string // Upstream history record finishTime: number // Unix timestamp of completion } code: number // 200 } ``` {% endtab %} {% tab v1_get_dreamina_images_jobid_model Failed %} Image generation failed. Includes error details. ```typescript { jobid: string type: 'image' | 'upscale' status: 'failed' model: string created: string updated: string request: { prompt?: string model?: string ratio?: string resolution?: string inputMode?: string replyUrl?: string replyRef?: string } error: string // Error summary errorDetails?: string // Additional details code: number // Error code } ``` **Common error codes:** | Code | Meaning | |------|---------| | 408 | Generation timed out (>1 hour) | | 596 | Account session expired | | 2038 | Content filtered | | 2057 | Upstream processing error | {% endtab %} {% endtabs %} ### Examples {% tabs v1_get_dreamina_images_jobid_examples %} {% tab v1_get_dreamina_images_jobid_examples Curl %} ```bash curl "https://api.useapi.net/v1/dreamina/images/j0302140530123456789i-u12345-US:user@example.com-bot:dreamina" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` {% endtab %} {% tab v1_get_dreamina_images_jobid_examples JavaScript %} ```javascript const apiToken = 'YOUR_API_TOKEN' const jobId = 'j0302140530123456789i-u12345-US:user@example.com-bot:dreamina' async function waitForImages(jobId, intervalMs = 10000) { while (true) { const response = await fetch(`https://api.useapi.net/v1/dreamina/images/${jobId}`, { headers: { 'Authorization': `Bearer ${apiToken}` } }) const job = await response.json() console.log(`Status: ${job.status}`) if (job.status === 'completed') { job.response.images.forEach((img, i) => console.log(` [${i}] ${img.width}x${img.height} ${img.format}`) ) return job } if (job.status === 'failed') throw new Error(job.error) await new Promise(resolve => setTimeout(resolve, intervalMs)) } } const job = await waitForImages(jobId) ``` {% endtab %} {% tab v1_get_dreamina_images_jobid_examples Python %} ```python import requests import time api_token = 'YOUR_API_TOKEN' job_id = 'j0302140530123456789i-u12345-US:user@example.com-bot:dreamina' def wait_for_images(job_id: str, interval_sec: int = 10) -> dict: while True: job = requests.get( f'https://api.useapi.net/v1/dreamina/images/{job_id}', headers={'Authorization': f'Bearer {api_token}'} ).json() print(f"Status: {job['status']}") if job['status'] == 'completed': for i, img in enumerate(job['response']['images']): print(f" [{i}] {img['width']}x{img['height']} {img['format']}") # Download image img_response = requests.get(img['imageUrl']) with open(f'image_{i}.jpeg', 'wb') as f: f.write(img_response.content) return job if job['status'] == 'failed': raise Exception(f"Job failed: {job.get('error')}") time.sleep(interval_sec) job = wait_for_images(job_id) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-scheduler === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-scheduler --- layout: default title: GET scheduler parent: Dreamina API v1 nav_order: 800 --- ## List Executing Jobs {: .no_toc } February 23, 2026 (March 2, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- List all currently executing (in-progress) video and image generation jobs, grouped by account. {: .get } > **https://api.useapi.net/v1/dreamina/scheduler** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Responses {% tabs v1_get_dreamina_scheduler_response %} {% tab v1_get_dreamina_scheduler_response 200 %} 200 OK Returns executing jobs grouped by account. ```json { "executing": { "US:user@example.com": [ { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "submitId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "model": "seedance-2.0", "elapsedSeconds": 45, "replyUrl": "https://your-domain.com/webhook" } ] }, "total": 1 } ``` When no jobs are executing: ```json { "executing": {}, "total": 0 } ``` {% endtab %} {% tab v1_get_dreamina_scheduler_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { executing: { [account: string]: Array<{ jobid: string // Job identifier submitId: string // Upstream submission ID model: string // Model used elapsedSeconds: number // Seconds since job was submitted replyUrl?: string // Webhook URL if configured }> } total: number // Total number of executing jobs } ``` ### Examples {% tabs v1_get_dreamina_scheduler_example %} {% tab v1_get_dreamina_scheduler_example Curl %} ``` bash curl -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/dreamina/scheduler" ``` {% endtab %} {% tab v1_get_dreamina_scheduler_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const response = await fetch('https://api.useapi.net/v1/dreamina/scheduler', { headers: { 'Authorization': `Bearer ${token}` } }); const scheduler = await response.json(); console.log('Executing jobs:', scheduler.total); for (const [account, jobs] of Object.entries(scheduler.executing)) { console.log(` ${account}: ${jobs.length} jobs`); } ``` {% endtab %} {% tab v1_get_dreamina_scheduler_example Python %} ``` python import requests token = 'YOUR_API_TOKEN' headers = {'Authorization': f'Bearer {token}'} response = requests.get('https://api.useapi.net/v1/dreamina/scheduler', headers=headers) scheduler = response.json() print(f"Executing jobs: {scheduler['total']}") for account, jobs in scheduler['executing'].items(): print(f" {account}: {len(jobs)} jobs") ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-videos-jobid === Document URL: https://useapi.net/docs/api-dreamina-v1/get-dreamina-videos-jobid --- layout: default title: GET videos/jobid parent: Dreamina API v1 nav_order: 700 --- ## Retrieve Job Status {: .no_toc } February 23, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Retrieve the status and result of a video generation job by its job ID. Use this endpoint to poll for completion after submitting a video via [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos). Jobs are retained for 30 days. {: .get } > **https://api.useapi.net/v1/dreamina/videos/`jobid`** ### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Path Parameters - `jobid` is **required**, the unique job identifier returned from [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos). ### Responses {% tabs v1_get_dreamina_videos_jobid_response %} {% tab v1_get_dreamina_videos_jobid_response 200 %} 200 OK Returns the job record with current status and details. **Processing (status: created):** ```json { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "type": "video", "status": "created", "model": "seedance-2.0", "created": "2026-02-23T14:05:30.123Z", "request": { "prompt": "A serene mountain landscape at sunset", "model": "seedance-2.0", "ratio": "16:9", "duration": 5, "inputMode": "prompt" }, "response": { "forecastCost": 125 }, "code": 200 } ``` **Completed:** ```json { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "type": "video", "status": "completed", "model": "seedance-2.0", "created": "2026-02-23T14:05:30.123Z", "updated": "2026-02-23T14:07:15.456Z", "request": { "prompt": "A serene mountain landscape at sunset", "model": "seedance-2.0", "ratio": "16:9", "duration": 5, "inputMode": "prompt" }, "response": { "assetId": "US:user@example.com-306191137798:7341234567890123456", "videoUrl": "https://v3-web.douyinvod.com/...", "videoId": "7341234567890123456", "coverUrl": "https://p9-sign.douyinpic.com/...", "width": 1280, "height": 720, "durationMs": 5042, "hasAudio": false, "forecastCost": 125, "finishTime": 1708700835 }, "code": 200 } ``` **Failed:** ```json { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "type": "video", "status": "failed", "model": "seedance-2.0", "created": "2026-02-23T14:05:30.123Z", "updated": "2026-02-23T14:07:15.456Z", "request": { "prompt": "A test prompt", "model": "seedance-2.0", "ratio": "16:9", "duration": 5, "inputMode": "prompt" }, "error": "fail_code: 2043", "errorDetails": "OutputVideoRisk", "code": 2043 } ``` **Note:** Jobs older than 1 hour that are still `created` are auto-marked as failed with `"Generation timed out"` (code `408`). {% endtab %} {% tab v1_get_dreamina_videos_jobid_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_get_dreamina_videos_jobid_response 404 %} 404 Not Found Job not found, belongs to a different user, or has expired (>30 days). ```json { "error": "Job not found" } ``` {% endtab %} {% endtabs %} ### Model {% tabs v1_get_dreamina_videos_jobid_model %} {% tab v1_get_dreamina_videos_jobid_model Completed %} Video generation completed. Includes video URL and metadata. ```typescript { jobid: string // Unique job identifier type: 'video' // Job type status: 'completed' model: string // Model used created: string // ISO 8601 timestamp updated: string // ISO 8601 timestamp request: { prompt?: string model: string ratio?: string duration?: number inputMode: string // "prompt" | "first_frame" | "end_frame" | "multi_frame" firstFrameRef?: string endFrameRef?: string frame_1_imageRef?: string // Keyframe refs (multi_frame mode) frame_1_prompt?: string frame_1_duration?: number frame_2_imageRef?: string frame_2_prompt?: string frame_2_duration?: number replyUrl?: string replyRef?: string } response: { assetId: string // For DELETE /assets/ videoUrl: string // Direct video URL (MP4) videoId: string // Dreamina video ID coverUrl: string // Video cover/thumbnail URL width: number // Video width in pixels height: number // Video height in pixels durationMs: number // Video duration in milliseconds hasAudio: boolean // Whether video has audio forecastCost: number // Credit cost finishTime: number // Unix timestamp of completion } code: number // 200 } ``` {% endtab %} {% tab v1_get_dreamina_videos_jobid_model Failed %} Video generation failed. Includes error details. ```typescript { jobid: string // Unique job identifier type: 'video' status: 'failed' model: string created: string // ISO 8601 timestamp updated: string // ISO 8601 timestamp request: { prompt?: string model: string ratio?: string duration?: number inputMode: string firstFrameRef?: string endFrameRef?: string replyUrl?: string replyRef?: string } error: string // Error summary (e.g., "fail_code: 2043") errorDetails?: string // Additional details (e.g., "OutputVideoRisk") code: number // Error code (e.g., 2043, 408, 596) } ``` **Common error codes:** | Code | Meaning | |------|---------| | 408 | Generation timed out (>1 hour) | | 596 | Account session expired | | 2038 | Content filtered | | 2043 | Output video moderation risk | {% endtab %} {% endtabs %} ### Examples {% tabs v1_get_dreamina_videos_jobid_examples %} {% tab v1_get_dreamina_videos_jobid_examples Curl %} ```bash # Get job status curl "https://api.useapi.net/v1/dreamina/videos/j0223140530123456789v-u12345-US:user@example.com-bot:dreamina" \ -H "Authorization: Bearer YOUR_API_TOKEN" # Poll for completion (check every 10 seconds) while true; do RESULT=$(curl -s "https://api.useapi.net/v1/dreamina/videos/$JOBID" \ -H "Authorization: Bearer YOUR_API_TOKEN") STATUS=$(echo "$RESULT" | jq -r '.status') echo "Status: $STATUS" if [[ "$STATUS" == "completed" ]]; then echo "$RESULT" | jq -r '.response.videoUrl' break fi if [[ "$STATUS" == "failed" ]]; then echo "$RESULT" | jq -r '.error' break fi sleep 10 done ``` {% endtab %} {% tab v1_get_dreamina_videos_jobid_examples JavaScript %} ```javascript const apiToken = 'YOUR_API_TOKEN' const jobId = 'j0223140530123456789v-u12345-US:user@example.com-bot:dreamina' async function getJobStatus(jobId) { const response = await fetch(`https://api.useapi.net/v1/dreamina/videos/${jobId}`, { headers: { 'Authorization': `Bearer ${apiToken}` } }) return await response.json() } // Poll until completion async function waitForCompletion(jobId, intervalMs = 10000) { while (true) { const job = await getJobStatus(jobId) console.log(`Status: ${job.status}`) if (job.status === 'completed') { console.log('Video URL:', job.response.videoUrl) console.log('Dimensions:', `${job.response.width}x${job.response.height}`) console.log('Duration:', `${job.response.durationMs}ms`) return job } if (job.status === 'failed') { console.error('Job failed:', job.error) throw new Error(job.error) } await new Promise(resolve => setTimeout(resolve, intervalMs)) } } const job = await waitForCompletion(jobId) ``` {% endtab %} {% tab v1_get_dreamina_videos_jobid_examples Python %} ```python import requests import time api_token = 'YOUR_API_TOKEN' job_id = 'j0223140530123456789v-u12345-US:user@example.com-bot:dreamina' def get_job_status(job_id: str) -> dict: response = requests.get( f'https://api.useapi.net/v1/dreamina/videos/{job_id}', headers={'Authorization': f'Bearer {api_token}'} ) response.raise_for_status() return response.json() def wait_for_completion(job_id: str, interval_sec: int = 10) -> dict: while True: job = get_job_status(job_id) print(f"Status: {job['status']}") if job['status'] == 'completed': print(f"Video URL: {job['response']['videoUrl']}") print(f"Dimensions: {job['response']['width']}x{job['response']['height']}") # Download video video_response = requests.get(job['response']['videoUrl']) with open('output.mp4', 'wb') as f: f.write(video_response.content) print('Video saved to output.mp4') return job if job['status'] == 'failed': raise Exception(f"Job failed: {job.get('error')}") time.sleep(interval_sec) job = wait_for_completion(job_id) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/index === Document URL: https://useapi.net/docs/api-dreamina-v1/index --- layout: default title: Dreamina API v1 nav_order: 2100 has_children: true permalink: /docs/api-dreamina-v1 --- # Dreamina API v1 February 23, 2026 (March 4, 2026) This is the [experimental](../../docs/legal) API for [Dreamina](https://dreamina.capcut.com/) by [ByteDance](https://www.bytedance.com/). [Dreamina](https://dreamina.capcut.com/) creates AI-generated videos and images using models from [ByteDance's Seed](https://seed.bytedance.com/) family. **Video generation models (US region):** - `seedance-2.0` — Latest model, supports text-to-video, image-to-video (first frame), and end frame modes. 4-12 second duration. - `seedance-1.5-pro` — Pro model with 5/10/12 second durations. - `seedance-1.0-mini` — Supports text-to-video, image-to-video, and multi-frame keyframe mode. 5/10 second duration. **Image generation models (US region):** - `seedream-5.0-lite` — Latest Seedream model, 2K/4K resolution, up to 6 reference images, auto ratio. - `seedream-4.6` — Latest stable model, 2K/4K resolution, up to 6 reference images, auto ratio. - `seedream-4.5` — High quality, 2K/4K resolution, up to 6 reference images, auto ratio. - `seedream-4.1` — 2K/4K resolution, up to 6 reference images, auto ratio. - `seedream-4.0` — Balanced quality/speed, 2K/4K resolution, up to 6 reference images, auto ratio. - `nano-banana` — Fast generation, 1K resolution, up to 3 reference images. - `seedream-3.0` — 1K/2K resolution, max 1 reference image, no auto ratio. **Image upscale** to 2K/4K/8K resolution via [POST /images/upscale](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images-upscale). **Cost estimate ([Dreamina Advanced](https://dreamina.capcut.com/) subscription):** - Monthly plan ($40/mo, 30K credits): a single 12-second Seedance 2.0 video costs 72 credits — approximately **$0.095 per generation**. - Yearly plan ($335/yr, 30K credits/mo): cost drops to under **$0.07 per generation**. - Every account also receives 2 free generations per day, further reducing effective cost. - Both plans include free and unlimited Seedream 4.0 image generation, including 2K resolution. ⚙️ [Setup Dreamina](../../docs/start-here/setup-dreamina) 📦 [Postman collection](https://www.postman.com/useapinet/useapi-net/collection) (March 4, 2026) 🤖 [LLM-friendly API spec](https://useapi.net/assets/aibot/api-dreamina-v1.txt) Feed this to your LLM to build integrations Examples: * [16+ AI Image Models: The Showdown](/blog/260309i) * [Seedream 4.5 and Seedance 2.0](/blog/260302) * [Seedance 2.0](/blog/260223) Developer Community: * Discord Server * Telegram Channel === URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-accounts === Document URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-accounts --- layout: default title: POST accounts parent: Dreamina API v1 nav_order: 200 --- ## Configure Dreamina Account {: .no_toc } February 23, 2026 (March 2, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Configure your Dreamina account for API access using email and password credentials. See [Setup Dreamina](../start-here/setup-dreamina) for details. {: .post } > **https://api.useapi.net/v1/dreamina/accounts** ### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json # Alternatively you can use multipart/form-data # Content-Type: multipart/form-data ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Request Body ```json { "email": "user@example.com", "password": "your-password", "region": "US", "maxJobs": 10 } ``` - `email` is **required**. Dreamina account email address. - `password` is **required**. Dreamina account password. - `region` is **required**. Region code. Supported value: `US`. - `maxJobs` is optional. Maximum concurrent jobs for this account (1-50, default: `10`). ### Responses {% tabs v1_post_dreamina_accounts_response %} {% tab v1_post_dreamina_accounts_response 200 %} 200 OK Account configured successfully. ```json { "account": "US:user@example.com", "email": "user@example.com", "region": "US", "maxJobs": 10, "sessionExpires": "2026-04-24T12:00:00.000Z", "session": { "expires": "2026-04-24T12:00:00.000Z", "lastRefreshed": "2026-02-23T12:00:00.000Z", "daysUntilExpiry": 60 }, "models": { "video": ["seedance-2.0", "seedance-1.5-pro", "seedance-1.0-mini"], "image": ["seedream-4.5", "seedream-4.1", "seedream-4.0", "nano-banana", "seedream-3.0"] }, "credits": { "total": 500, "vip": 200, "gift": 200, "purchase": 100, "dailyClaimed": false } } ``` {% endtab %} {% tab v1_post_dreamina_accounts_response 400 %} 400 Bad Request Validation error (missing/invalid parameters). ```json { "error": "Parameter email is required" } ``` {% endtab %} {% tab v1_post_dreamina_accounts_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_post_dreamina_accounts_response 402 %} 402 Payment Required Subscription expired or insufficient credits. ```json { "error": "Account has no subscription or subscription expired" } ``` {% endtab %} {% tab v1_post_dreamina_accounts_response 500 %} 500 Internal Server Error Login failed (bad credentials, upstream error). ```json { "error": "Login failed: invalid credentials" } ``` {% endtab %} {% endtabs %} ### Model - `account` - Account identifier - `email` - Dreamina account email - `region` - Region code - `maxJobs` - Maximum concurrent jobs - `sessionExpires` - ISO 8601 timestamp when session expires - `session` - Session details including refresh timing - `models` - Available video and image generation models - `credits` - Credit balance breakdown ```typescript { // TypeScript, all fields are optional account: string // "US:user@example.com" email: string region: string // "US" maxJobs: number // 1-50 sessionExpires: string // ISO 8601 timestamp session: { expires: string // ISO 8601 timestamp lastRefreshed: string // ISO 8601 timestamp daysUntilExpiry: number } models: { video: string[] // Available video model names image: string[] // Available image model names } credits: { total: number vip: number gift: number purchase: number dailyClaimed: boolean } error?: string // Error message } ``` ### Examples {% tabs v1_post_dreamina_accounts_example %} {% tab v1_post_dreamina_accounts_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -X POST "https://api.useapi.net/v1/dreamina/accounts" \ -d '{ "email": "user@example.com", "password": "your-password", "region": "US" }' ``` {% endtab %} {% tab v1_post_dreamina_accounts_example JavaScript %} ``` javascript const apiUrl = 'https://api.useapi.net/v1/dreamina/accounts'; const token = 'YOUR_API_TOKEN'; const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'user@example.com', password: 'your-password', region: 'US' }) }); const result = await response.json(); console.log('Account configured:', result); ``` {% endtab %} {% tab v1_post_dreamina_accounts_example Python %} ``` python import requests apiUrl = 'https://api.useapi.net/v1/dreamina/accounts' token = 'YOUR_API_TOKEN' headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' } body = { 'email': 'user@example.com', 'password': 'your-password', 'region': 'US' } response = requests.post(apiUrl, headers=headers, json=body) print(response.status_code, response.json()) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-assets-account === Document URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-assets-account --- layout: default title: POST assets/account parent: Dreamina API v1 nav_order: 500 --- ## Upload Assets {: .no_toc } February 23, 2026 (March 2, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Upload images to Dreamina for use as video or image generation reference frames. Supported formats are JPEG, PNG, and WebP with a maximum file size of 10 MB. | Content-Type | File Extension | | ------------ | -------------- | | image/jpeg | jpeg, jpg | | image/png | png | | image/webp | webp | The returned `assetRef` is used as `firstFrameRef`, `endFrameRef`, or `frame_N_imageRef` in [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos), and as `imageRef_N` in [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images). {: .post } > **https://api.useapi.net/v1/dreamina/assets/`account`** ### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: select from the table above ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. - `Content-Type` is **required**, see table above. ### Path Parameters - `account` is **required**. ### Request Body Binary image content (raw bytes). ### Responses {% tabs v1_post_dreamina_assets_response %} {% tab v1_post_dreamina_assets_response 200 %} 200 OK Image uploaded successfully. Returns the `assetRef` for use in video and image generation. ```json { "assetRef": "US:user@example.com-image:w685:h900:s86866-uri:tos-useast5-i-wopfjsm1ax-tx/3605b150c6b949f5acea2eac3ca59544", "account": "US:user@example.com", "width": 685, "height": 900, "size": 86866 } ``` - `assetRef` - Reference ID for use in [POST /videos](https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos) as `firstFrameRef`, `endFrameRef`, or `frame_N_imageRef`, and in [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images) as `imageRef_N`. - `width` - Image width in pixels. - `height` - Image height in pixels. - `size` - Image size in bytes. - `account` - Account used for the upload. **assetRef format:** `-image:w:h:s-uri:` {% endtab %} {% tab v1_post_dreamina_assets_response 400 %} 400 Bad Request Invalid request (empty content, unsupported content type, or file too large). ```json { "error": "Content-Type (image/bmp) not supported. Valid values: image/jpeg, image/png, image/webp" } ``` ```json { "error": "Image is empty" } ``` {% endtab %} {% tab v1_post_dreamina_assets_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_post_dreamina_assets_response 404 %} 404 Not Found Account not found or not configured. ```json { "error": "Unable to find configuration for account US:user@example.com" } ``` {% endtab %} {% tab v1_post_dreamina_assets_response 596 %} 596 Session Error Account session expired. Re-add the account using [POST /accounts](https://useapi.net/docs/api-dreamina-v1/post-dreamina-accounts) with correct credentials. ```json { "error": "Session expired" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { assetRef: string // Reference ID for POST /videos and POST /images account: string // "US:user@example.com" width: number // Image width in pixels height: number // Image height in pixels size: number // Image size in bytes imageRef?: string // Legacy alias for assetRef (backward compatibility) error?: string // Error message } ``` ### Examples {% tabs v1_post_dreamina_assets_example %} {% tab v1_post_dreamina_assets_example Curl %} ``` bash curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: image/jpeg" \ --data-binary @/path/to/your/image.jpeg \ "https://api.useapi.net/v1/dreamina/assets/US:user@example.com" ``` {% endtab %} {% tab v1_post_dreamina_assets_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const account = 'US:user@example.com'; const apiUrl = `https://api.useapi.net/v1/dreamina/assets/${encodeURIComponent(account)}`; // Load image - Example 1: From local file (Node.js) const fsp = require('fs').promises; const blob = new Blob([await fsp.readFile('./image.jpeg')]); // Load image - Example 2: From file input element // const imageFile = document.getElementById('image-file'); // const blob = imageFile.files[0]; const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': blob.type || 'image/jpeg' }, body: blob }); const result = await response.json(); console.log('Upload result:', result); console.log('assetRef:', result.assetRef); ``` {% endtab %} {% tab v1_post_dreamina_assets_example Python %} ``` python import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' account = 'US:user@example.com' api_url = f'https://api.useapi.net/v1/dreamina/assets/{quote(account, safe="")}' with open('./image.jpeg', 'rb') as image_file: file_content = image_file.read() headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'image/jpeg' } response = requests.post(api_url, headers=headers, data=file_content) result = response.json() print('Upload result:', result) print('assetRef:', result.get('assetRef')) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-images-upscale === Document URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-images-upscale --- layout: default title: POST images/upscale parent: Dreamina API v1 nav_order: 730 --- ## Upscale Image {: .no_toc } March 2, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Upscale a generated image to higher resolution (2K, 4K, or 8K). Requires a completed image generation job from [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images). Upscale is asynchronous — poll [GET /images/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid) for the result. {: .post } > **https://api.useapi.net/v1/dreamina/images/upscale** ### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Request Body ```json { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "imageIndex": 0, "upscaleResolution": "4k" } ``` - `jobid` is **required**. The job ID of a completed image generation job from [POST /images](https://useapi.net/docs/api-dreamina-v1/post-dreamina-images). - `imageIndex` is optional. Index of the image to upscale from the source job (0-3, default: `0`). Each generation produces up to 4 images. - `upscaleResolution` is optional. Target resolution (default: `4k`). Supported values: `2k`, `4k`, `8k`. - `originalImageStrength` is optional. How much of the original image to preserve (0-1, default: `0.65`). - `detailStrength` is optional. Detail enhancement level (0-1, default: `0.5`). - `replyUrl` is optional, webhook URL for job status callbacks. - `replyRef` is optional, custom reference string passed back in webhook callbacks. - `maxJobs` is optional, override max concurrent jobs for this request (1-50). ### Responses {% tabs v1_post_dreamina_images_upscale_response %} {% tab v1_post_dreamina_images_upscale_response 200 %} 200 OK Upscale job created. Poll [GET /images/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid) for the result. ```json { "jobid": "j0302140630123456789I-u12345-US:user@example.com-bot:dreamina", "type": "upscale", "status": "created", "model": "seedream-4.0", "created": "2026-03-02T14:06:30.123Z", "request": { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "imageIndex": 0, "resolution": "4k" }, "response": { "forecastCost": 0 }, "code": 200 } ``` {% endtab %} {% tab v1_post_dreamina_images_upscale_response 400 %} 400 Bad Request Validation error. ```json { "error": "Parameter jobid is required" } ``` ```json { "error": "Source image job is created, must be completed" } ``` {% endtab %} {% tab v1_post_dreamina_images_upscale_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_post_dreamina_images_upscale_response 404 %} 404 Not Found Source image job not found. ```json { "error": "Source image job not found" } ``` {% endtab %} {% endtabs %} ### Examples {% tabs v1_post_dreamina_images_upscale_example %} {% tab v1_post_dreamina_images_upscale_example Curl %} ``` bash curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "imageIndex": 0, "upscaleResolution": "4k" }' \ "https://api.useapi.net/v1/dreamina/images/upscale" ``` {% endtab %} {% tab v1_post_dreamina_images_upscale_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const response = await fetch('https://api.useapi.net/v1/dreamina/images/upscale', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ jobid: 'j0302140530123456789i-u12345-US:user@example.com-bot:dreamina', imageIndex: 0, upscaleResolution: '4k' }) }); const result = await response.json(); console.log('Upscale job:', result.jobid); // Poll for completion const poll = async (jobid) => { while (true) { const res = await fetch(`https://api.useapi.net/v1/dreamina/images/${jobid}`, { headers: { 'Authorization': `Bearer ${token}` } }); const job = await res.json(); if (job.status === 'completed') { console.log('Upscaled:', job.response.images[0].width, 'x', job.response.images[0].height); return job; } if (job.status === 'failed') throw new Error(job.error); await new Promise(r => setTimeout(r, 10000)); } }; await poll(result.jobid); ``` {% endtab %} {% tab v1_post_dreamina_images_upscale_example Python %} ``` python import requests import time token = 'YOUR_API_TOKEN' response = requests.post( 'https://api.useapi.net/v1/dreamina/images/upscale', headers={ 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' }, json={ 'jobid': 'j0302140530123456789i-u12345-US:user@example.com-bot:dreamina', 'imageIndex': 0, 'upscaleResolution': '4k' } ) result = response.json() print(f"Upscale job: {result['jobid']}") # Poll for completion jobid = result['jobid'] while True: job = requests.get( f'https://api.useapi.net/v1/dreamina/images/{jobid}', headers={'Authorization': f'Bearer {token}'} ).json() if job['status'] == 'completed': img = job['response']['images'][0] print(f"Upscaled: {img['width']}x{img['height']}") break if job['status'] == 'failed': raise Exception(job.get('error')) time.sleep(10) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-images === Document URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-images --- layout: default title: POST images parent: Dreamina API v1 nav_order: 710 --- ## Generate Images {: .no_toc } March 4, 2026 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Generate images using Dreamina AI models from text prompts with optional reference images. All image generation is asynchronous — this endpoint returns immediately with a job ID. Poll [GET /images/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid) for completion, or use `replyUrl` webhook for automatic callbacks. Each generation produces up to 4 images. Generation typically completes within 15-120 seconds depending on the model and resolution. ### US Models | Model | Resolutions | Default | Max Refs | Prompt Required | Auto Ratio | |-------|-------------|---------|----------|-----------------|------------| | `seedream-5.0-lite`
(**free**) | 2k, 4k | 2k | 6 | No
(imageRef_x only) | Yes | | `seedream-4.6`
(default, **free**) | 2k, 4k | 2k | 6 | No
(imageRef_x only) | Yes | | `seedream-4.5` | 2k, 4k | 2k | 6 | No
(imageRef_x only) | Yes | | `seedream-4.1` | 2k, 4k | 2k | 6 | No
(imageRef_x only) | Yes | | `seedream-4.0`
(**free**) | 2k, 4k | 2k | 6 | No
(imageRef_x only) | Yes | | `nano-banana` | 1k | 1k | 3 | Yes | Yes | | `seedream-3.0` | 1k, 2k | 1k | 1 | Yes | No | {: .post } > **https://api.useapi.net/v1/dreamina/images** ### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json # Alternatively you can use multipart/form-data # Content-Type: multipart/form-data ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Request Body ```json { "prompt": "A stunning aurora borealis over a frozen lake at midnight", "model": "seedream-4.6", "ratio": "16:9", "resolution": "2k" } ``` - `account` is optional. Specific account to use. Auto-selected (random with available capacity) if omitted. Not needed when `imageRef_N` provided — account is derived from the reference. - `prompt` is **required**, optional when model supports `imageRef_N`. Maximum 1600 characters. - `model` is optional, see [US Models](#us-models) above. - `ratio` is optional, image aspect ratio (default: `auto` for models that support it, `1:1` otherwise). Supported values: `auto`, `1:1`, `3:4`, `16:9`, `4:3`, `9:16`, `2:3`, `3:2`, `21:9`. - `resolution` is optional, output resolution tier (default depends on model — see Model Capabilities). Supported values: `1k`, `2k`, `4k`. - `imageRef_1`…`imageRef_6` are optional. Reference images from [POST /assets/`account`](https://useapi.net/docs/api-dreamina-v1/post-dreamina-assets-account) or completed image job `assetRef`. Must be contiguous, max per model see [US Models](#us-models). - `imageStrength` is optional, reference image influence strength (0-1, default: `0.5`). - `replyUrl` is optional, webhook URL for job status callbacks. - `replyRef` is optional, custom reference string passed back in webhook callbacks. - `maxJobs` is optional, override max concurrent jobs for this request (1-50). ### Responses {% tabs v1_post_dreamina_images_response %} {% tab v1_post_dreamina_images_response 200 %} 200 OK Job created successfully. Images are generating in the background. ```json { "jobid": "j0302140530123456789i-u12345-US:user@example.com-bot:dreamina", "type": "image", "status": "created", "model": "seedream-4.6", "created": "2026-03-02T14:05:30.123Z", "request": { "prompt": "A stunning aurora borealis over a frozen lake at midnight", "model": "seedream-4.6", "ratio": "16:9", "resolution": "2k", "inputMode": "generate", "replyUrl": "https://your-domain.com/webhook", "replyRef": "my-ref-123" }, "response": { "forecastCost": 0 }, "code": 200 } ``` Poll [GET /images/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-images-jobid) for completion status, or use `replyUrl` for webhook callbacks. {% endtab %} {% tab v1_post_dreamina_images_response 400 %} 400 Bad Request Validation error. ```json { "error": "Parameter model (invalid-model) valid values: seedream-5.0-lite, seedream-4.6, seedream-4.5, seedream-4.1, seedream-4.0, nano-banana, seedream-3.0" } ``` {% endtab %} {% tab v1_post_dreamina_images_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_post_dreamina_images_response 429 %} 429 Too Many Requests All accounts at maximum capacity. ```json { "error": "All accounts at capacity" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { jobid: string // Unique job identifier type: 'image' // Job type status: 'created' // Initial status model: string // Model used created: string // ISO 8601 timestamp request: { prompt?: string model: string ratio?: string resolution?: string inputMode: string // Auto-detected from params imageRef_1?: string // Reference image assetRef (when provided) imageRef_2?: string imageRef_3?: string replyUrl?: string replyRef?: string } response: { forecastCost: number // Estimated credit cost } code: number // HTTP status code error?: string } ``` ### Examples {% tabs v1_post_dreamina_images_example %} {% tab v1_post_dreamina_images_example Curl %} ``` bash # Text-to-image curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A stunning aurora borealis over a frozen lake", "model": "seedream-4.6", "ratio": "16:9", "resolution": "2k" }' \ "https://api.useapi.net/v1/dreamina/images" # With reference image curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A dreamy reinterpretation with soft pastel colors", "model": "seedream-4.1", "imageRef_1": "US:user@example.com-image:w685:h900:s86866-uri:tos-useast5-i-wopfjsm1ax-tx/abc123", "imageStrength": 0.5 }' \ "https://api.useapi.net/v1/dreamina/images" ``` {% endtab %} {% tab v1_post_dreamina_images_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const apiUrl = 'https://api.useapi.net/v1/dreamina/images'; // Text-to-image const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A stunning aurora borealis over a frozen lake', model: 'seedream-4.6', ratio: '16:9', resolution: '2k' }) }); const result = await response.json(); console.log('Job created:', result.jobid); // Poll for completion const poll = async (jobid) => { while (true) { const res = await fetch(`https://api.useapi.net/v1/dreamina/images/${jobid}`, { headers: { 'Authorization': `Bearer ${token}` } }); const job = await res.json(); console.log('Status:', job.status); if (job.status === 'completed') { console.log('Images:', job.response.images.length); job.response.images.forEach((img, i) => console.log(` [${i}] ${img.width}x${img.height} ${img.imageUrl}`) ); return job; } if (job.status === 'failed') throw new Error(job.error); await new Promise(r => setTimeout(r, 10000)); } }; const completed = await poll(result.jobid); ``` {% endtab %} {% tab v1_post_dreamina_images_example Python %} ``` python import requests import time token = 'YOUR_API_TOKEN' api_url = 'https://api.useapi.net/v1/dreamina/images' headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' } # Text-to-image data = { 'prompt': 'A stunning aurora borealis over a frozen lake', 'model': 'seedream-4.6', 'ratio': '16:9', 'resolution': '2k' } response = requests.post(api_url, headers=headers, json=data) result = response.json() print(f"Job created: {result['jobid']}") # Poll for completion jobid = result['jobid'] while True: job = requests.get( f'https://api.useapi.net/v1/dreamina/images/{jobid}', headers={'Authorization': f'Bearer {token}'} ).json() print(f"Status: {job['status']}") if job['status'] == 'completed': for i, img in enumerate(job['response']['images']): print(f" [{i}] {img['width']}x{img['height']} {img['imageUrl']}") break if job['status'] == 'failed': raise Exception(job.get('error')) time.sleep(10) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos === Document URL: https://useapi.net/docs/api-dreamina-v1/post-dreamina-videos --- layout: default title: POST videos parent: Dreamina API v1 nav_order: 600 --- ## Generate Videos {: .no_toc } February 23, 2026 (March 2, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Generate videos using Dreamina AI models from text prompts with optional image frames. All video generation is asynchronous — this endpoint returns immediately with a job ID. Poll [GET /videos/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-videos-jobid) for completion, or use `replyUrl` webhook for automatic callbacks. Video generation typically completes within 60-180 seconds depending on the model and duration. ### Input Modes The input mode is automatically determined from the provided parameters: | Mode | Trigger | Description | |------|---------|-------------| | `prompt` | No image refs | Text-to-video generation | | `first_frame` | `firstFrameRef` provided | Video starts from uploaded image | | `end_frame` | `firstFrameRef` + `endFrameRef` | Video transitions between two images | | `multi_frame` | `frame_N_imageRef` params | 2-10 keyframe images with per-frame prompts | ### US Model Capabilities | Model | Durations (seconds) | Input Modes | |-------|---------------------|-------------| | `seedance-2.0` (default) | 4, 5, 6, 7, 8, 9, 10, 11, 12 | prompt, first_frame, end_frame | | `seedance-1.5-pro` | 5, 10, 12 | prompt, first_frame, end_frame | | `seedance-1.0-mini` | 5, 10 | prompt, first_frame, multi_frame | {: .post } > **https://api.useapi.net/v1/dreamina/videos** ### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json # Alternatively you can use multipart/form-data # Content-Type: multipart/form-data ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ### Request Body ```json { "prompt": "A serene mountain landscape at sunset with camera slowly panning right", "model": "seedance-2.0", "ratio": "16:9", "duration": 5 } ``` - `account` is optional. Specific account to use. Auto-inferred from image refs if provided. Auto-selected (random with available capacity) if omitted. - `prompt` is **required** for `prompt` mode. Optional for `first_frame` and `end_frame`. Cannot be used with `multi_frame` mode (use `frame_N_prompt` instead). Maximum 5000 characters. - `model` is optional, the AI model to use (default: `seedance-2.0`). Supported values: `seedance-2.0`, `seedance-1.5-pro`, `seedance-1.0-mini`. - `ratio` is optional, video aspect ratio (default: `16:9`). Cannot be specified when image refs are provided (image aspect ratio is used). - `duration` is optional, video duration in seconds (default: `5`). Valid values depend on model — see Model Capabilities table. - `firstFrameRef` is optional, `imageRef` from [POST /assets/`account`](https://useapi.net/docs/api-dreamina-v1/post-dreamina-assets-account) for the starting frame. Triggers `first_frame` mode. - `endFrameRef` is optional, `imageRef` for the ending frame. Triggers `end_frame` mode. Requires `firstFrameRef`. - `frame_N_imageRef` is optional (N=1-10), `imageRef` for keyframe N. Triggers `multi_frame` mode when at least 2 frames are provided. - `frame_N_prompt` is optional, per-frame prompt for multi_frame mode. Maximum 5000 characters. - `frame_N_duration` is optional, per-frame duration in seconds for multi_frame mode (1-6, default: `5`). - `replyUrl` is optional, webhook URL for job status callbacks. Receives POST requests with the job record on submission and on completion/failure. - `replyRef` is optional, custom reference string passed back in webhook callbacks. - `maxJobs` is optional, override max concurrent jobs for this request (1-50). **Multi-frame constraints:** - Minimum 2 frames, maximum 10 frames - No gaps allowed (frame_1 through frame_N must be contiguous) - All frame images must have the same aspect ratio - Top-level `prompt` cannot be used (use `frame_N_prompt` instead) - `firstFrameRef`/`endFrameRef` cannot be combined with multi_frame - Total duration of non-last frames must equal a valid model duration ### Responses {% tabs v1_post_dreamina_videos_response %} {% tab v1_post_dreamina_videos_response 200 %} 200 OK Job created successfully. Video is generating in the background. ```json { "jobid": "j0223140530123456789v-u12345-US:user@example.com-bot:dreamina", "type": "video", "status": "created", "model": "seedance-2.0", "created": "2026-02-23T14:05:30.123Z", "request": { "prompt": "A serene mountain landscape at sunset with camera slowly panning right", "model": "seedance-2.0", "ratio": "16:9", "duration": 5, "inputMode": "prompt" }, "response": { "forecastCost": 125 }, "code": 200 } ``` Poll [GET /videos/`jobid`](https://useapi.net/docs/api-dreamina-v1/get-dreamina-videos-jobid) for completion status, or use `replyUrl` for webhook callbacks. {% endtab %} {% tab v1_post_dreamina_videos_response 400 %} 400 Bad Request Validation error. ```json { "error": "Parameter model (invalid-model) valid values: seedance-2.0, seedance-1.5-pro, seedance-1.0-mini" } ``` {% endtab %} {% tab v1_post_dreamina_videos_response 401 %} 401 Unauthorized Invalid API token. ```json { "error": "Unauthorized" } ``` {% endtab %} {% tab v1_post_dreamina_videos_response 402 %} 402 Payment Required Subscription expired or insufficient credits. ```json { "error": "Account has no subscription or subscription expired" } ``` {% endtab %} {% tab v1_post_dreamina_videos_response 429 %} 429 Too Many Requests All accounts at maximum capacity. Wait for current jobs to complete or increase `maxJobs`. ```json { "error": "All accounts at capacity" } ``` {% endtab %} {% tab v1_post_dreamina_videos_response 596 %} 596 Session Error Account session expired. Re-add the account using [POST /accounts](https://useapi.net/docs/api-dreamina-v1/post-dreamina-accounts) with correct credentials. ```json { "error": "Session expired" } ``` {% endtab %} {% endtabs %} ### Model ```typescript { jobid: string // Unique job identifier type: 'video' // Job type status: 'created' // Initial status model: string // Model used created: string // ISO 8601 timestamp request: { prompt?: string model: string ratio?: string // "16:9", "9:16", etc. duration?: number // Seconds inputMode: string // "prompt" | "first_frame" | "end_frame" | "multi_frame" firstFrameRef?: string // imageRef for first frame endFrameRef?: string // imageRef for end frame frame_1_imageRef?: string // Keyframe refs (multi_frame mode) frame_1_prompt?: string frame_1_duration?: number frame_2_imageRef?: string frame_2_prompt?: string frame_2_duration?: number replyUrl?: string // Webhook URL replyRef?: string // Custom reference } response: { forecastCost: number // Estimated credit cost } code: number // HTTP status code error?: string // Error message } ``` ### Examples {% tabs v1_post_dreamina_videos_example %} {% tab v1_post_dreamina_videos_example Curl %} ``` bash # Text-to-video curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A serene mountain landscape at sunset", "model": "seedance-2.0", "ratio": "16:9", "duration": 5 }' \ "https://api.useapi.net/v1/dreamina/videos" # Image-to-video (first frame) curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Camera slowly pans across the scene", "model": "seedance-2.0", "firstFrameRef": "US:user@example.com-image:w685:h900:s86866-uri:tos-useast5-i-wopfjsm1ax-tx/abc123", "duration": 5 }' \ "https://api.useapi.net/v1/dreamina/videos" ``` {% endtab %} {% tab v1_post_dreamina_videos_example JavaScript %} ``` javascript const token = 'YOUR_API_TOKEN'; const apiUrl = 'https://api.useapi.net/v1/dreamina/videos'; // Text-to-video const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A serene mountain landscape at sunset', model: 'seedance-2.0', ratio: '16:9', duration: 5 }) }); const result = await response.json(); console.log('Job created:', result.jobid); // Poll for completion const poll = async (jobid) => { while (true) { const res = await fetch(`https://api.useapi.net/v1/dreamina/videos/${jobid}`, { headers: { 'Authorization': `Bearer ${token}` } }); const job = await res.json(); console.log('Status:', job.status); if (job.status === 'completed') { console.log('Video URL:', job.response.videoUrl); return job; } if (job.status === 'failed') throw new Error(job.error); await new Promise(r => setTimeout(r, 10000)); } }; const completed = await poll(result.jobid); ``` {% endtab %} {% tab v1_post_dreamina_videos_example Python %} ``` python import requests import time token = 'YOUR_API_TOKEN' api_url = 'https://api.useapi.net/v1/dreamina/videos' headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' } # Text-to-video data = { 'prompt': 'A serene mountain landscape at sunset', 'model': 'seedance-2.0', 'ratio': '16:9', 'duration': 5 } response = requests.post(api_url, headers=headers, json=data) result = response.json() print(f"Job created: {result['jobid']}") # Poll for completion jobid = result['jobid'] while True: job = requests.get( f'https://api.useapi.net/v1/dreamina/videos/{jobid}', headers={'Authorization': f'Bearer {token}'} ).json() print(f"Status: {job['status']}") if job['status'] == 'completed': print(f"Video URL: {job['response']['videoUrl']}") break if job['status'] == 'failed': raise Exception(job.get('error')) time.sleep(10) ``` {% endtab %} {% endtabs %} ### Try It
=== URL: https://useapi.net/docs/start-here/setup-faceswap === Document URL: https://useapi.net/docs/start-here/setup-faceswap --- layout: default title: Setup InsightFaceSwap parent: Start Here nav_order: 500 --- # Setup InsightFaceSwap {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} Approximately 3 minutes to complete setup steps. --- {: .note } > This is the setup guide for [InsightFaceSwap API](../api-faceswap-v1). A [Discord](https://discord.com) account and a [useapi.net subscription](../subscription) are required for the API to work. ## Create Discord account You need a [Discord](https://discord.com) account to interact with [InsightFaceSwap Discord bot](https://discord.gg/Ym3X8U59ZN). Create a [new account](https://discord.com/register) if you don't have one already. Please note even if you have an existing Discord account we are **strongly** recommending creating a separate Discord account specifically designated to be used with useapi.net API. ## Create Discord server Please log in to your Discord account and create a new Discord server following [official instructions](https://support.discord.com/hc/en-us/articles/204849977-How-do-I-create-a-server-). ## Create `#api` text channel on your Discord server Once you created the Discord server you need to create a designated for API-related work text channel. You can refer to [official instructions](https://support.discord.com/hc/en-us/articles/4412085582359-Text-Channels-Text-Chat-In-Voice-Channels) to learn about Discord channels and how to manage them on your server. We suggest naming the text channel `#api` for clarity and also making that channel private. Please see [Midjourney instructions](https://docs.midjourney.com/docs/invite-the-bot) to learn how you can restrict the bot to a single private channel. ## Join Picsi.Ai - Powered by InsightFace Discord Server Follow Picsi.Ai [instructions](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md) and join official [Picsi.Ai - Powered by InsightFace Discord Server](https://discord.gg/Ym3X8U59ZN). ## Add InsightFaceSwap bot to your Discord server Please follow [official instructions](https://discord.com/channels/1095014106576212101/1128550062683865178/1189604165006135379) to add InsightFaceSwap bot to your Discord server created earlier. ## Example of Discord server with private `#api` text channel and InsightFace bot Below you can see we created `useapi` Discord server with private `#api` text channel: ![](../../assets/images/discord_faceswap_server_setup_example.png) InsightFace bot invited to the server and has access to private `#api` text channel ![](../../assets/images/discord_faceswap_channel_setup_example.png) ## Test InsightFace bot Navigate to the created above `#api` text channel and execute few InsightFaceSwap bot command(s) to make sure it works. ## Make a note of your server id and channel id values Your Discord URL looks like `https://discord.com/channels//` In the screenshot above URL is `https://discord.com/channels/1122226477161144546/1122277481822456166` where `1122226477161144546` is your Discord server id and `1122277481822456166` is your private `#api` channel id. Save both server id and channel id values, you will need those numbers for API. ## Obtain Discord token There are many tutorials describing how to obtain Discord tokens. Please refer to the following links bellow for additional guidance: - [How to Find Your Discord Token](https://discordhelp.net/discord-token) - [How To Get Your Discord Token](https://pcstrike.com/how-to-get-discord-token/) - [How to get Discord Token](https://linuxhint.com/get-discord-token/) Keep in mind that anyone with a Discord token can have **full access** to your Discord account so please keep it **safe** and **secure**. To reset your Discord token simply change your Discord password. ## Verify Discord access Once all the above steps are completed you should have the following: - Discord token - Discord server id number - Discord private `#api` channel id number This only verifies that the token, server id and channel id values are correct. To complete setup, you **MUST** proceed to [POST account/`channel`](../api-faceswap-v1/post-faceswap-account-channel) and complete the configuration. ##### Server {: .no_toc }
##### Channel {: .no_toc }
=== URL: https://useapi.net/docs/api-faceswap-v1 === Document URL: https://useapi.net/docs/api-faceswap-v1 --- layout: default title: InsightFaceSwap API v1 nav_order: 9000 has_children: true permalink: /docs/api-faceswap-v1 --- # InsightFaceSwap API v1 February 2024 This is [experimental](../../docs/legal) API for [InsightFaceSwap Discord Bot](https://discord.gg/Ym3X8U59ZN) by [Picsi.Ai](https://www.picsi.ai/). InsightFaceSwap allows users to swap faces from source image(s) onto different target images. It offers free and paid [subscription](https://www.patreon.com/picsi) models. Paid subscribers have access to a wide selection of extra features such as [HiFidelity Mode](https://www.patreon.com/posts/89036144), [ARTIFY](https://www.patreon.com/posts/picsi-ai-v2-0-97389077), oldify/youngify, morphing multiple faces in one image, and [many more](https://discord.com/channels/1095014106576212101/1128550062683865178). [Setup InsightFaceSwap](../../docs/start-here/setup-faceswap) [Postman collection](https://www.postman.com/useapinet/useapi-net/collection) (January 20, 2026) [LLM-friendly API spec](https://useapi.net/assets/aibot/api-faceswap-v1.txt) Feed this to your LLM to build integrations Official documentation links: - [Discord support channel](https://discord.com/channels/1095014106576212101/1128550062683865178) - [Patreon support channel](https://www.patreon.com/picsi/posts) - [YouTube channel](https://www.youtube.com/@PicsiAi) #### Example source code on GitHub * [Face swap and animate images generated by Midjourney using InsightFaceSwap and Pika (using webhook)](https://github.com/useapi/examples/tree/main/imagine-faceswap-animate) February 19, 2024 Developer Community: * Discord Server * Telegram Channel * Reddit Group === URL: https://useapi.net/docs/api-faceswap-v1/del-faceswap-account-channel === Document URL: https://useapi.net/docs/api-faceswap-v1/del-faceswap-account-channel --- layout: default title: DEL faceswap/account/channel parent: InsightFaceSwap API v1 nav_order: 400 --- ## Delete InsightFaceSwap account {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- {: .delete } > **https://api.useapi.net/v1/faceswap/account/`channel`** The `channel` value should correspond to an account configured previously via a [POST](post-faceswap-account-channel) request. ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs del_account_InsightFaceSwap_response %} {% tab del_account_InsightFaceSwap_response 204 %} 204 No Content {% endtab %} {% tab del_account_InsightFaceSwap_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab del_account_InsightFaceSwap_response 404 %} 404 Not Found {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional error: string, errorDetails: string, code: number } ``` ##### Examples {% tabs del_account_InsightFaceSwap_example %} {% tab del_account_InsightFaceSwap_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X DELETE https://api.useapi.net/v1/faceswap/account/ ``` {% endtab %} {% tab del_account_InsightFaceSwap_example JavaScript %} ``` javascript const channel = "Previously configured channel id"; const apiUrl = `https://api.useapi.net/v1/faceswap/account/${channnel}`; const token = "API token"; const data = { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' } }; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab del_account_InsightFaceSwap_example Python %} ``` python import requests channel = "Previously configured channel id" apiUrl = f"https://api.useapi.net/v1/faceswap/account/{channel}" token = "API token" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-faceswap-v1/del-faceswap-delid === Document URL: https://useapi.net/docs/api-faceswap-v1/del-faceswap-delid --- layout: default title: DEL faceswap/delid parent: InsightFaceSwap API v1 nav_order: 1100 --- ## InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) command {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Use this endpoint to submit the InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) command to your [InsightFaceSwap Discord channel](../start-here/setup-faceswap). The result will be returned in the response body and can also be sent as a callback to an optional [`replyUrl`](#request-body). This is a blocking call, you will **not** be able to make another call to the same InsightFaceSwap Discord channel until the current call is completed. The average execution time is approximately 3 to 10 seconds. If you expect high load and need to make multiple concurrent calls, please consider setting up [multiple InsightFaceSwap accounts](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel). It is **important** not to use the InsightFaceSwap account setup for API access for any purposes other than its intended use, such as executing `/delid` or any other InsightFaceSwap commands _manually_ or in conjunction with _any other_ automation tools. The useapi.net API internally tracks the usage of the InsightFaceSwap account, including the number of currently active executions. Using it for other activities may cause API to function incorrectly. {: .delete } > **https://api.useapi.net/v1/faceswap/delid** ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: multipart/form-data ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Request Body ```json { "channel": "Discord channel id", "idname": "idname param", } ``` - `channel` is optional when only one [faceswap/account](../api-faceswap-v1/get-faceswap-account) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `idname` is **required**, please refer to InsightFaceSwap [/delid](https://github.com/deepinsight/insightface/blob/master/web-demos/swapping_discord/README.md#delid-name) for details. - `replyUrl` is optional, if not provided value from [useapi.net account](../account-management/get-account) will be used. Place here your callback URL. API will call the provided `replyUrl` once job completed or failed. Maximum length 1024 characters. We recommend using sites like [webhook.site](https://webhook.site) to test callback URL functionality. - `replyRef` is optional, place here your reference id which will be stored and returned along with this job response / result. Maximum length 1024 characters. ##### Responses {% tabs post_faceswap-delid_response %} {% tab post_faceswap-delid_response 200 %} 200 OK Field `content` contains message generated by InsightFaceSwap. ```json { "jobid": "", "verb": "faceswap-delid", "status": "completed", "idname": "me", "created": "2023-09-09T02:04:49.667Z", "updated": "2023-09-09T02:04:53.490Z", "discord": "", "server": "", "channel": "", "replyUrl": "https://webhook.site/abc", "replyRef": "", "messageId": "", "content": "idname me deleted", "timestamp": "2023-09-09T02:04:51.926000+00:00", "code": 200 } ``` {% endtab %} {% tab post_faceswap-delid_response 400 %} 400 Bad Request ```json { "error": "Required param idname is missing or empty" "Optional param replyRef is too long" "Optional param replyUrl is too long" "Required param channel is missing or empty" "Configuration not found for channel , to create POST v1/faceswap/account/" "code": 400 } ``` {% endtab %} {% tab post_faceswap-delid_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab post_faceswap-delid_response 402 %} 402 Payment Required ```json { "error": "Account has no subscription or subscription expired", "code": 402 } ``` {% endtab %} {% tab post_faceswap-delid_response 429 %} 429 Too Many Requests Wait in a loop for **at least** 10..30 seconds and retry again. There are two possible cases for API response 429. 1. API query is full and can not accept new [faceswap/delid](#insightfaceswap-delid-command) requests. ```json { "error": "Unable to lock Discord after attempts", "code": 429 } ``` 2. The API received an HTTP status 429 from the Discord API when it attempted to POST to the `/interactions` endpoint. Under normal circumstances, this should be a rare occurrence because the API is designed to strictly adhere to Discord rate limits. However, in certain scenarios, Discord may still issue a 429 response. ```json { "error": "Discord /interactions failed with HTTP status 429", "errorDetails": "{\"global\":true,\"message\":\"You are being rate limited.\",\"retry_after\":10}", "code": 429 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional jobid: string, verb: 'faceswap-delid', status: 'completed' | 'failed', idname: string, created: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC updated: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC discord: string, // Provided for debugging purposes only, contains the first 3 and the last 3 characters of the original value server: string, channel: string, replyUrl: string, replyRef: string, messageId: string, content: string, // Contains message generated by InsightFaceSwap timestamp: string, error: string, errorDetails: string, code: number } ``` ##### Examples {% tabs faceswap-delid_example %} {% tab faceswap-delid_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Authorization: Bearer …" \ -X DELETE https://api.useapi.net/v1/faceswap/delid \ -F "channel=" \ -F "idname=" ``` {% endtab %} {% tab faceswap-delid_example JavaScript %} ``` javascript const main = async () => { const apiUrl = "https://api.useapi.net/v1/faceswap/delid"; const token = "API token"; const channel = "Discord channel"; const idname = "idname"; const data = { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } }; const formData = new FormData(); formData.append("channel", channel); formData.append("idname", idname); data.body = formData; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", { response, result }); }; main() ``` {% endtab %} {% tab faceswap-delid_example Python %} ``` python import requests api_url = "https://api.useapi.net/v1/faceswap/delid" token = "API token" channel = "Discord channel" idname = "idname" headers = { 'Authorization': f'Bearer {token}' } files = { 'channel': (None, channel), 'idname': (None, idname) } response = requests.delete(api_url, headers=headers, files=files) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-account-channel === Document URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-account-channel --- layout: default title: GET faceswap/account/channel parent: InsightFaceSwap API v1 nav_order: 200 --- ## Retrieve InsightFaceSwap configuration for `channel` {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- {: .get } > **https://api.useapi.net/v1/faceswap/account/`channel`** The `channel` value should correspond to an account configured previously via a [POST](post-faceswap-account-channel) request. ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs get_account_InsightFaceSwap_channel_response %} {% tab get_account_InsightFaceSwap_channel_response 200 %} 200 OK ```json { "server": "Discord server id", "channel": "Discord channel id", "discord": "Discord token", "credits": { "timestamp": "2024-02-01T02:05:24.991000+00:00", "total": 50, "used": 18 } } ``` {% endtab %} {% tab get_account_InsightFaceSwap_channel_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab get_account_InsightFaceSwap_channel_response 404 %} 404 Not Found Configuration not found. To create configuration use [faceswap/account/`channel`](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel). {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional discord: string, server: string, channel: string, credits: { timestamp: string, total: number, used: number } } ``` ##### Examples {% tabs get_account_InsightFaceSwap_channel_example %} {% tab get_account_InsightFaceSwap_channel_example Curl %} ``` bash curl https://api.useapi.net/v1/faceswap/account/ \ -H "Accept: application/json" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab get_account_InsightFaceSwap_channel_example JavaScript %} ``` javascript const token = "API token"; const channel = "Previously configured channel id"; const apiUrl = `https://api.useapi.net/v1/faceswap/account/${channel}`; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab get_account_InsightFaceSwap_channel_example Python %} ``` python import requests token = "API token" channel = "Previously configured channel id" apiUrl = f"https://api.useapi.net/v1/faceswap/account/{channel}" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-account === Document URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-account --- layout: default title: GET faceswap/account parent: InsightFaceSwap API v1 nav_order: 100 --- ## Retrieve InsightFaceSwap accounts information {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Before you start using the API, you **must** [configure](../start-here/setup-faceswap) at least one InsightFaceSwap Discord account. You may specify multiple InsightFaceSwap accounts, the API will automatically perform load balancing by randomly selecting an account with available credits before making calls to InsightFaceSwap Discord bot. This endpoint retrieves the complete list of configured accounts for InsightFaceSwap. {: .get } > **https://api.useapi.net/v1/faceswap/account** ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: application/json ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs account_InsightFaceSwap_response %} {% tab account_InsightFaceSwap_response 200 %} 200 OK ```json { "Discord channel A": { "server": "Discord server A", "channel": "Discord channel A", "discord": "Discord token A", "credits": { "timestamp": "2024-02-01T02:05:24.991000+00:00", "total": 50, "used": 18 }, }, "Discord channel B": { "server": "Discord server B", "channel": "Discord channel B", "discord": "Discord token B" }, "Discord channel N": { "server": "Discord server N", "channel": "Discord channel N", "discord": "Discord token N", "credits": { "timestamp": "2024-02-01T03:17:48.159000+00:00", "total": 200, "used": 115 } } } ``` {% endtab %} {% tab account_InsightFaceSwap_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab account_InsightFaceSwap_response 404 %} 404 Not Found Configuration not found. To create configuration use [faceswap/account/`channel`](https://useapi.net/docs/api-faceswap-v1/post-faceswap-account-channel). {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional [channel: string]: { discord: string, server: string, channel: string, credits: { timestamp: string, total: number, used: number } } } ``` ##### Examples {% tabs account_InsightFaceSwap_example %} {% tab account_InsightFaceSwap_example Curl %} ``` bash curl https://api.useapi.net/v1/faceswap/account \ -H "Accept: application/json" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab account_InsightFaceSwap_example JavaScript %} ``` javascript const token = "API token"; const apiUrl = "https://api.useapi.net/v1/faceswap/account"; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab account_InsightFaceSwap_example Python %} ``` python import requests token = "API token" apiUrl = "https://api.useapi.net/v1/faceswap/account" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-jobid === Document URL: https://useapi.net/docs/api-faceswap-v1/get-faceswap-jobid --- layout: default title: GET faceswap/jobs/?jobid=jobid parent: InsightFaceSwap API v1 nav_order: 1300 --- ## Retrieve InsightFaceSwap job status and results {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Use this endpoint to retrieve status and results of - [faceswap/headshot](../api-faceswap-v1/post-faceswap-headshot) - [faceswap/changebg](../api-faceswap-v1/post-faceswap-changebg) - [faceswap/picsi](../api-faceswap-v1/post-faceswap-picsi) with initial jobs status returned `started` If you specified optional parameter [`replyUrl`](../api-faceswap-v1/post-faceswap-headshot#request-body) you technically do not need to use this endpoint to retrieve results since API will call provided `replyUrl` once job generation completed. **Important** API periodically polls (checks) Discord every 15 to 60 seconds (depending on the load) and updates all currently executed jobs statuses and results. Polling interval is used for safety reasons, aiming to prevent any potential issues with Discord and InsightFaceSwap, such as bans or excessive requests. Jobs lifespan guaranteed to be at least 31 days, after that they will be expired and may be recycled. {: .get } > **https://api.useapi.net/v1/faceswap/jobs/?jobid=`jobid`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Query Parameter `jobid` is **required**, use value returned by - [faceswap/headshot](../api-faceswap-v1/post-faceswap-headshot) - [faceswap/changebg](../api-faceswap-v1/post-faceswap-changebg) - [faceswap/picsi](../api-faceswap-v1/post-faceswap-picsi) with initial jobs status returned `started` ##### Responses {:toc} {% tabs get_faceswap_jobid_response %} {% tab get_faceswap_jobid_response 200 %} 200 OK If field `status` value is *created*, *started* or *progress* wait in a loop for **at least** 10..30 seconds and retry again. When completed retrieve generated images or video from `attachments` array. Field `content` contains message generated by InsightFaceSwap reflecting current generation parameters and progress. Optional array `embeds` contains additional information. ```json { "jobid": "", "verb": "faceswap-headshot", "status": "completed", "created": "2023-09-09T02:04:49.667Z", "updated": "2023-09-09T02:19:20.256Z", "prompt": "me, a mad king with an evil smile, wearing medieval royal blue attire and a crown. --no green --square", "discord": "", "server": "", "channel": "", "messageId": "", "content": "<@Discord user id> Picsi.Ai Headshot Job Submitted [jobid: 8a1f574fdbf79e8cd57e070476d9d5f3] [credits: 4] [prompt: 'a mad king with an evil smile, wearing medieval royal blue attire and a crown. --no green --square'] [time: