=== URL: https://useapi.net/docs/start-here/setup-tempolor === Document URL: https://useapi.net/docs/start-here/setup-tempolor --- layout: default title: Setup TemPolor parent: Start Here nav_order: 260 --- # Setup TemPolor {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} Approximately 5 minutes to complete setup steps. --- [TemPolor](https://www.tempolor.com), an AI-powered, royalty-free **music generation** service that creates high-quality soundtracks from text prompts, custom lyrics, MIDI, and supports voice cloning. TemPolor offers extensive customization for instrumental tracks, including chords and BPM. Supports export in mp3, wav, and stems, and it can generate stems from users' audio files. Up to 10 tracks can be generated concurrently, with **unlimited** generations available on the [Ultra](https://www.tempolor.com/pricing) plan. ## Create TemPolor account Create a [TemPolor](https://www.tempolor.com) account if you don't have one already. ## Locate your TemPolor `requestParams` Open a Chromium-compatible browser (e.g. [Google Chrome](https://www.google.com/chrome/), [Microsoft Edge](https://www.microsoft.com/en-us/edge), or [Opera](https://www.opera.com/)) and navigate to your TemPolor account profile page [https://www.tempolor.com/account/profile](https://www.tempolor.com/account/profile) `1`. ![](../../assets/images/tempolor_setup_1.png) Refresh the page `2`. Once the page is fully loaded, ensure that you're logged in and current page is [https://www.tempolor.com/account/profile](https://www.tempolor.com/account/profile). Open [Developer Tools](https://developer.chrome.com/docs/devtools) by right-clicking on the page and selecting "Inspect Element" or via [keyboard shortcuts](https://developer.chrome.com/docs/devtools/shortcuts): Mac `Command+Option+I` or Windows `F12` or `Control+Shift+I`. Select Developer Tools » Network `3`: * Make sure that `All` or `Fetch/XHR` is selected `4`. * Type `/getWebSelfUserInfo` in the filter box `5` and hit Enter. * You should see a single HTTP call entry as shown below `6` and click on that entry. * Select the "Payload" tab `7`. * Locate and select the "Request Payload" header `8`. * Right-click on the `requestParams` and copy its content `9`. This is your `requestParams`.
As an example above, the requestParams (JSON) ```json { "requestParams": { "sv": "alpha/beta/release", "ver_code": 20000, "lang": "french", "la": "fr-FR", "di": "e23c9f7db8ced478b8574923817c2b6a", "pf": "100", "mi": "Windows", "biz": 378, "utdid": "e23c9f7db8ced478b8574923817c2b6a", "ts": 1849982225671, "service_ticket": "hUUCp7MeIAXpXKo9AOP5zPlJLqVZh81C2MWlZdTuqoGbNqzlgQNjBwtxdYnJPRA52Wn=", "ucid": "100349856", "user_id": "100349856", "member_level": 0, "is_visitor": 0, "vip_type": 20, "app_id": "material", "app": "web", "ve": "2.0.0", "entry": "web_main", "fr": "web", "ip": "88.222.199.44", "business_type": "material", "la_multi": "fr", "b_ts": "1849512371543", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.39 (KHTML, like Gecko) Chrome/122.1.0.0 Safari/537.39 OPR/123.0.0.0", "web_terminal": "web_pc" } } ```
## Configure TemPolor API account This is a **REQUIRED** step, you **MUST** complete it in order to use your TemPolor account via our API. Feel free to use the optional [Verify](#verify-requestparams-value) feature below to ensure all the retrieved values above are correct before proceeding. Finally, proceed to [POST /accounts](../api-tempolor-v1/post-tempolor-accounts) and configure the TemPolor API account using the `requestParams` value retrieved above. Once the configuration is posted, you can start using the TemPolor API immediately. ## Verify `requestParams` value This only verifies that the `requestParams` value is correct. To complete setup, you **MUST** proceed to [POST /accounts](../api-tempolor-v1/post-tempolor-accounts) and complete the configuration of the TemPolor API account using the `requestParams` value retrieved above.
=== URL: https://useapi.net/docs/api-tempolor-v1 === Document URL: https://useapi.net/docs/api-tempolor-v1 --- layout: default title: TemPolor API v1 nav_order: 8000 has_children: true permalink: /docs/api-tempolor-v1 --- # TemPolor API v1 May 15, 2025 This is an [experimental](../../docs/legal) API for [TemPolor](https://www.tempolor.com), an AI-powered, royalty-free **music generation** service that creates high-quality soundtracks from text prompts, custom lyrics, MIDI, and supports voice cloning. TemPolor offers extensive customization for instrumental tracks, including chords and BPM. Supports export in mp3, wav, and stems, and it can generate stems from users' audio files. Up to 10 tracks can be generated concurrently, with **unlimited** generations available on the [Ultra](https://www.tempolor.com/pricing) plan. Using the [Ultra $30/m](https://www.tempolor.com/pricing) TemPolor web subscription used by this API, you can generate an **unlimited** number of songs. Compare this to the official API pricing, which starts at [$300/m](https://platform.tempolor.com/pricing) for 10,000 songs per month. [Setup TemPolor](../../docs/start-here/setup-tempolor) [Postman collection](https://www.postman.com/useapinet/useapi-net/collection) (January 20, 2026) [LLM-friendly API spec](https://useapi.net/assets/aibot/api-tempolor-v1.txt) Feed this to your LLM to build integrations Articles: * [TemPolor API Samples](/blog/250515) Developer Community: * Discord Server * Telegram Channel * r/TemPolorAPI === URL: https://useapi.net/docs/api-tempolor-v1/del-tempolor-accounts-user_id === Document URL: https://useapi.net/docs/api-tempolor-v1/del-tempolor-accounts-user_id --- layout: default title: DELETE accounts/user_id parent: TemPolor API v1 nav_order: 400 --- ## Delete TemPolor API account {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint deletes a TemPolor API account configuration. [Setup TemPolor](../../docs/start-here/setup-tempolor) {: .delete } > **https://api.useapi.net/v1/tempolor/accounts/`user_id`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs del_tempolor_accounts_user_id_response %} {% tab del_tempolor_accounts_user_id_response 204 %} 204 No Content Account configuration was successfully deleted. {% endtab %} {% tab del_tempolor_accounts_user_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab del_tempolor_accounts_user_id_response 404 %} 404 Not Found Account configuration not found. {% endtab %} {% endtabs %} ##### Examples {% tabs del_tempolor_accounts_user_id_example %} {% tab del_tempolor_accounts_user_id_example Curl %} ``` bash curl -X DELETE https://api.useapi.net/v1/tempolor/accounts/ \ -H "Accept: application/json" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab del_tempolor_accounts_user_id_example JavaScript %} ``` javascript const token = "API token"; const user_id = "Previously configured account"; const apiUrl = `https://api.useapi.net/v1/tempolor/accounts/${user_id}`; const response = await fetch(apiUrl, { method: 'DELETE', headers: { "Authorization": `Bearer ${token}`, } }); console.log("response", response); ``` {% endtab %} {% tab del_tempolor_accounts_user_id_example Python %} ``` python import requests token = "API token" user_id = "Previously configured account" apiUrl = f"https://api.useapi.net/v1/tempolor/accounts/{user_id}" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) print(response) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/del-tempolor-scheduler-job_id === Document URL: https://useapi.net/docs/api-tempolor-v1/del-tempolor-scheduler-job_id --- layout: default title: DELETE scheduler/job_id parent: TemPolor API v1 nav_order: 2100 --- ## Cancel a running job {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint cancels a running API job from being tracked by the scheduler. The job will still be executed by TemPolor, but the API will no longer track its progress. {: .delete } > **https://api.useapi.net/v1/tempolor/scheduler/job_id** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `job_id` is **required**. The job to cancel, as returned from [POST music/song](../api-tempolor-v1/post-tempolor-music-song), [POST music/instrumental](../api-tempolor-v1/post-tempolor-music-instrumental), or [GET scheduler](../api-tempolor-v1/get-tempolor-scheduler). ##### Responses {% tabs del_TemPolor_scheduler_job_id_response %} {% tab del_TemPolor_scheduler_job_id_response 204 %} 204 No Content Job was successfully cancelled. {% endtab %} {% tab del_TemPolor_scheduler_job_id_response 400 %} 400 Bad Request The job_id format is invalid. ```json { "error": "job_id has incorrect format", "code": 400 } ``` {% endtab %} {% tab del_TemPolor_scheduler_job_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab del_TemPolor_scheduler_job_id_response 404 %} 404 Not Found The specified job was not found or could not be cancelled. ```json { "error": "Unable to locate running job_id", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Examples {% tabs del_TemPolor_scheduler_job_id_example %} {% tab del_TemPolor_scheduler_job_id_example Curl %} ``` bash curl -X DELETE "https://api.useapi.net/v1/tempolor/scheduler/" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab del_TemPolor_scheduler_job_id_example JavaScript %} ``` javascript const token = "API token"; const job_id = "user:12345-tempolor:user_id-job:abcdef123456789"; const apiUrl = `https://api.useapi.net/v1/tempolor/scheduler/${job_id}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}` } }); if (response.status === 204) { console.log("Job cancelled successfully"); } else { const errorData = await response.json(); console.error("Failed to cancel job:", errorData); } ``` {% endtab %} {% tab del_TemPolor_scheduler_job_id_example Python %} ``` python import requests token = "API token" job_id = "user:12345-tempolor:user_id-job:abcdef123456789" api_url = f"https://api.useapi.net/v1/tempolor/scheduler/{job_id}" headers = { 'Authorization': f'Bearer {token}' } response = requests.delete(api_url, headers=headers) if response.status_code == 204: print("Job cancelled successfully") else: try: error_data = response.json() print(f"Failed to cancel job: {error_data}") except: print(f"Failed to cancel job: {response.status_code}") ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-cloned-voices-clonedVoiceItemId === Document URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-cloned-voices-clonedVoiceItemId --- layout: default title: DELETE music/cloned-voices parent: TemPolor API v1 nav_order: 1900 --- ## Delete a cloned voice {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint deletes a previously created cloned voice. {: .delete } > **https://api.useapi.net/v1/tempolor/music/cloned-voices/`clonedVoiceItemId`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `clonedVoiceItemId` is **required**. The cloned voice ID returned from a previous [POST music/cloned-voices](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-cloned-voices) request. ##### Responses {% tabs delete_tempolor_music_cloned_voices_clonedVoiceItemId_response %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_response 200 %} 200 OK ```json { "result": true } ``` {% endtab %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_response 400 %} 400 Bad Request ```json { "error": "clonedVoiceItemId has incorrect format", "code": 400 } ``` {% endtab %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_response 404 %} 404 Not Found ```json { "error": "No record found for user:12345-tempolor:user_id-voice:abcdef123456789", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean error: string code: number } ``` ##### Examples {% tabs delete_tempolor_music_cloned_voices_clonedVoiceItemId_example %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_example Curl %} ``` bash curl -X DELETE -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/cloned-voices/user:12345-tempolor:user_id-voice:abcdef123456789 ``` {% endtab %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_example JavaScript %} ``` javascript const clonedVoiceItemId = "user:12345-tempolor:user_id-voice:abcdef123456789"; const token = "API token"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/cloned-voices/${clonedVoiceItemId}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Delete result:", result.result); ``` {% endtab %} {% tab delete_tempolor_music_cloned_voices_clonedVoiceItemId_example Python %} ``` python import requests cloned_voice_item_id = "user:12345-tempolor:user_id-voice:abcdef123456789" token = "API token" apiUrl = f"https://api.useapi.net/v1/tempolor/music/cloned-voices/{cloned_voice_item_id}" headers = { "Authorization": f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) result = response.json() print(f"Delete result: {result.get('result')}") ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-job_id === Document URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-job_id --- layout: default title: DELETE music/job_id parent: TemPolor API v1 nav_order: 1100 --- ## Delete a music generation {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint deletes a previously generated music item. {: .delete } > **https://api.useapi.net/v1/tempolor/music/`job_id`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `job_id` is **required**. The job returned from a previous [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) or [POST music/instrumental](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental) request. ##### Responses {% tabs delete_tempolor_music_job_id_response %} {% tab delete_tempolor_music_job_id_response 200 %} 200 OK ```json { "result": true } ``` {% endtab %} {% tab delete_tempolor_music_job_id_response 400 %} 400 Bad Request ```json { "error": "job_id has incorrect format", "code": 400 } ``` {% endtab %} {% tab delete_tempolor_music_job_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab delete_tempolor_music_job_id_response 404 %} 404 Not Found ```json { "error": "No record found for user:12345-tempolor:user_id-job:abcdef123456789", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean error: string code: number } ``` ##### Examples {% tabs delete_tempolor_music_job_id_example %} {% tab delete_tempolor_music_job_id_example Curl %} ``` bash curl -X DELETE -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/user:12345-tempolor:user_id-job:abcdef123456789 ``` {% endtab %} {% tab delete_tempolor_music_job_id_example JavaScript %} ``` javascript const job_id = "user:12345-tempolor:user_id-job:abcdef123456789"; const token = "API token"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/${job_id}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Delete result:", result.result); ``` {% endtab %} {% tab delete_tempolor_music_job_id_example Python %} ``` python import requests job_id = "user:12345-tempolor:user_id-job:abcdef123456789" token = "API token" apiUrl = f"https://api.useapi.net/v1/tempolor/music/{job_id}" headers = { "Authorization": f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) result = response.json() print(f"Delete result: {result.get('result')}") ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-midi-midiItemId === Document URL: https://useapi.net/docs/api-tempolor-v1/delete-tempolor-music-midi-midiItemId --- layout: default title: DELETE music/midi parent: TemPolor API v1 nav_order: 1600 --- ## Delete a MIDI file {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint deletes a previously uploaded MIDI file. {: .delete } > **https://api.useapi.net/v1/tempolor/music/midi/`midiItemId`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `midiItemId` is **required**. The MIDI file ID returned from a previous [POST music/midi](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-midi) request. ##### Responses {% tabs delete_tempolor_music_midi_midiItemId_response %} {% tab delete_tempolor_music_midi_midiItemId_response 200 %} 200 OK ```json { "result": true } ``` {% endtab %} {% tab delete_tempolor_music_midi_midiItemId_response 400 %} 400 Bad Request ```json { "error": "midiItemId has incorrect format", "code": 400 } ``` {% endtab %} {% tab delete_tempolor_music_midi_midiItemId_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab delete_tempolor_music_midi_midiItemId_response 404 %} 404 Not Found ```json { "error": "No record found for user:12345-tempolor:user_id-midi:abcdef123456789", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean error: string code: number } ``` ##### Examples {% tabs delete_tempolor_music_midi_midiItemId_example %} {% tab delete_tempolor_music_midi_midiItemId_example Curl %} ``` bash curl -X DELETE -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/midi/user:12345-tempolor:user_id-midi:abcdef123456789 ``` {% endtab %} {% tab delete_tempolor_music_midi_midiItemId_example JavaScript %} ``` javascript const midiItemId = "user:12345-tempolor:user_id-midi:abcdef123456789"; const token = "API token"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/midi/${midiItemId}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Delete result:", result.result); ``` {% endtab %} {% tab delete_tempolor_music_midi_midiItemId_example Python %} ``` python import requests midi_item_id = "user:12345-tempolor:user_id-midi:abcdef123456789" token = "API token" apiUrl = f"https://api.useapi.net/v1/tempolor/music/midi/{midi_item_id}" headers = { "Authorization": f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) result = response.json() print(f"Delete result: {result.get('result')}") ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts-user_id === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts-user_id --- layout: default title: GET accounts/user_id parent: TemPolor API v1 nav_order: 300 --- ## Retrieve TemPolor API account configuration for `user_id` {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves the details of a specific TemPolor account. [Setup TemPolor](../../docs/start-here/setup-tempolor) {: .get } > **https://api.useapi.net/v1/tempolor/accounts/`user_id`** The `user_id` value should correspond to an account configured previously via a [POST accounts](post-tempolor-accounts) request. ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs get_tempolor_accounts_user_id_response %} {% tab get_tempolor_accounts_user_id_response 200 %} 200 OK ```json { "user_id": "user_id1", "updated": 1715791234567, "updatedUTC": "2025-05-15T14:30:34.567Z", "maxJobs": 10, "requestParams": {} } ``` {% endtab %} {% tab get_tempolor_accounts_user_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab get_tempolor_accounts_user_id_response 404 %} 404 Not Found Configuration not found. To create configuration use [POST accounts](https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts). {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript user_id: string updated: number // timestamp in milliseconds updatedUTC: string // ISO date string maxJobs: number requestParams: {} } ``` ##### Examples {% tabs get_tempolor_accounts_user_id_example %} {% tab get_tempolor_accounts_user_id_example Curl %} ``` bash curl https://api.useapi.net/v1/tempolor/accounts/ \ -H "Accept: application/json" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab get_tempolor_accounts_user_id_example JavaScript %} ``` javascript const token = "API token"; const user_id = "Previously configured account"; const apiUrl = `https://api.useapi.net/v1/tempolor/accounts/${user_id}`; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab get_tempolor_accounts_user_id_example Python %} ``` python import requests token = "API token" user_id = "Previously configured account" apiUrl = f"https://api.useapi.net/v1/tempolor/accounts/{user_id}" 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-tempolor-v1/get-tempolor-accounts === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts --- layout: default title: GET accounts parent: TemPolor API v1 nav_order: 200 --- ## Get List of Accounts {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves the complete list of configured API accounts for TemPolor. [Setup TemPolor](../../docs/start-here/setup-tempolor) {: .get } > **https://api.useapi.net/v1/tempolor/accounts** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs get_tempolor_accounts_response %} {% tab get_tempolor_accounts_response 200 %} 200 OK ```json { "user_id1": { "user_id": "user_id1", "updated": 1715791234567, "updatedUTC": "2025-05-15T14:30:34.567Z", "maxJobs": 10, "requestParams": {} }, "user_id2": { "user_id": "user_id2", "updated": 1715791234567, "updatedUTC": "2025-05-15T14:30:34.567Z", "maxJobs": 20, "requestParams": {} } } ``` {% endtab %} {% tab get_tempolor_accounts_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab get_tempolor_accounts_response 404 %} 404 Not Found Returned when no accounts are configured. {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript [user_id: string]: { user_id: string updated: number // timestamp in milliseconds updatedUTC: string // ISO date string maxJobs: number requestParams: {} } } ``` ##### Examples {% tabs get_tempolor_accounts_example %} {% tab get_tempolor_accounts_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Authorization: Bearer …" \ -X GET https://api.useapi.net/v1/tempolor/accounts ``` {% endtab %} {% tab get_tempolor_accounts_example JavaScript %} ``` javascript const apiUrl = `https://api.useapi.net/v1/tempolor/accounts`; const api_token = "API token"; const data = { method: 'GET', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' } }; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab get_tempolor_accounts_example Python %} ``` python import requests apiUrl = f"https://api.useapi.net/v1/tempolor/accounts" api_token = "API token" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {api_token}" } response = requests.get(apiUrl, headers=headers) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-artist-voices === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-artist-voices --- layout: default title: GET music/artist-voices parent: TemPolor API v1 nav_order: 1300 --- ## List artist voices {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves a list of predefined artist voices that you can use for music generation without uploading your own voice samples. These artist voices can be used with [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) by providing the `artistVoiceItemId` parameter. {: .get } > **https://api.useapi.net/v1/tempolor/music/artist-voices/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `cursor` is optional. Pagination cursor for fetching additional pages of results. ##### Responses {% tabs get_tempolor_music_artist_voices_response %} {% tab get_tempolor_music_artist_voices_response 200 %} 200 OK ```json { "records": [ { "ucid": "9999999", "bizType": "ai_voice_cloned", "itemId": "voice_12345", "name": "Deep Male Voice", "resourceUrl": "https://example.com/vocals/deep-male-sample.mp3", "coverUrl": "https://example.com/voice-covers/deep-male.jpg", "vocalUrl": "https://example.com/vocals/deep-male-sample.mp3", "weight": 100, "isAddRel": false, "relSource": "", "labels": ["male", "deep", "dramatic"] }, { "ucid": "9999999", "bizType": "ai_voice_cloned", "itemId": "voice_67890", "name": "Soprano Female Voice", "resourceUrl": "https://example.com/vocals/soprano-female-sample.mp3", "coverUrl": "https://example.com/voice-covers/soprano-female.jpg", "vocalUrl": "https://example.com/vocals/soprano-female-sample.mp3", "weight": 90, "isAddRel": false, "relSource": "", "labels": ["female", "soprano", "clear"] } ], "hasNext": false, "cursor": "", "sysTime": 1716565425000 } ``` {% endtab %} {% tab get_tempolor_music_artist_voices_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional records: { ucid: string bizType: string itemId: string name: string resourceUrl: string coverUrl: string vocalUrl: string weight: number isAddRel: boolean relSource: string labels: string[] }[] hasNext: boolean cursor: string sysTime: number error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_artist_voices_example %} {% tab get_tempolor_music_artist_voices_example Curl %} ``` bash # List all artist voices curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id=user_id # Paginate through results using cursor curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id=user_id&cursor=next_page_cursor_token" ``` {% endtab %} {% tab get_tempolor_music_artist_voices_example JavaScript %} ``` javascript const token = "API token"; const user_id = "user_id"; const cursor = ""; // for pagination // Build the URL with query parameters let apiUrl = `https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id=${user_id}`; if (cursor) apiUrl += `&cursor=${cursor}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log(`Found ${result.records?.length || 0} artist voices`); // Example of fetching all pages async function fetchAllArtistVoices(userId) { let allRecords = []; let nextCursor = ""; let hasMore = true; while (hasMore) { let url = `https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id=${userId}`; if (nextCursor) url += `&cursor=${nextCursor}`; const response = await fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const data = await response.json(); if (data.records && data.records.length > 0) { allRecords = [...allRecords, ...data.records]; } hasMore = data.hasNext; nextCursor = data.cursor; // Break if no more pages or no cursor if (!hasMore || !nextCursor) break; } return allRecords; } ``` {% endtab %} {% tab get_tempolor_music_artist_voices_example Python %} ``` python import requests token = "API token" user_id = "user_id" cursor = "" # for pagination # Build the URL with query parameters apiUrl = f"https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id={user_id}" if cursor: apiUrl += f"&cursor={cursor}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) result = response.json() print(f"Found {len(result.get('records', []))} artist voices") # Example of fetching all pages def fetch_all_artist_voices(user_id): all_records = [] next_cursor = "" has_more = True while has_more: url = f"https://api.useapi.net/v1/tempolor/music/artist-voices/?user_id={user_id}" if next_cursor: url += f"&cursor={next_cursor}" response = requests.get(url, headers=headers) data = response.json() if data.get('records'): all_records.extend(data.get('records')) has_more = data.get('hasNext', False) next_cursor = data.get('cursor', "") # Break if no more pages or no cursor if not has_more or not next_cursor: break return all_records ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-cloned-voices === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-cloned-voices --- layout: default title: GET music/cloned-voices parent: TemPolor API v1 nav_order: 1800 --- ## List cloned voices {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves a list of cloned voices that you've previously created using [POST music/cloned-voices](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-cloned-voices). These cloned voices can be used in music generation with [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song). {: .get } > **https://api.useapi.net/v1/tempolor/music/cloned-voices/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `cursor` is optional. Pagination cursor for fetching additional pages of results. ##### Responses {% tabs get_tempolor_music_cloned_voices_response %} {% tab get_tempolor_music_cloned_voices_response 200 %} 200 OK ```json { "records": [ { "isAddRel": false, "relSource": "", "ucid": "user_id", "bizType": "user", "operatorType": "gen", "itemId": "abcdef123456789", "rootItemId": "abcdef123456789", "parentItemId": "abcdef123456789", "name": "My Custom Voice", "resourceUrl": "voice_cloned/audio/abcdef123456789.mp3", "coverUrl": "", "readStatus": 0, "status": 30, "vocalUrl": "https://example.com/cloned-voice/abcdef123456789.mp3", "createTime": 1716565425000, "updateTime": 1716565700000, "labels": [], "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789" }, { "isAddRel": false, "relSource": "", "ucid": "user_id", "bizType": "user", "operatorType": "gen", "itemId": "fedcba987654321", "rootItemId": "fedcba987654321", "parentItemId": "fedcba987654321", "name": "Second Voice Sample", "resourceUrl": "voice_cloned/audio/fedcba987654321.mp3", "coverUrl": "", "readStatus": 0, "status": 30, "vocalUrl": "https://example.com/cloned-voice/fedcba987654321.mp3", "createTime": 1716475425000, "updateTime": 1716475700000, "labels": [], "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:fedcba987654321" } ], "hasNext": false, "cursor": "" } ``` {% endtab %} {% tab get_tempolor_music_cloned_voices_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional records: { isAddRel: boolean relSource: string ucid: string bizType: string operatorType: string itemId: string rootItemId: string parentItemId: string name: string resourceUrl: string coverUrl: string readStatus: number status: number vocalUrl: string createTime: number updateTime: number labels: string[] clonedVoiceItemId: string }[] hasNext: boolean cursor: string error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_cloned_voices_example %} {% tab get_tempolor_music_cloned_voices_example Curl %} ``` bash # List all cloned voices curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id=user_id # Paginate through results using cursor curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id=user_id&cursor=next_page_cursor_token" ``` {% endtab %} {% tab get_tempolor_music_cloned_voices_example JavaScript %} ``` javascript const token = "API token"; const user_id = "user_id"; const cursor = ""; // for pagination // Build the URL with query parameters let apiUrl = `https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id=${user_id}`; if (cursor) apiUrl += `&cursor=${cursor}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log(`Found ${result.records?.length || 0} cloned voices`); // Example of fetching all pages async function fetchAllClonedVoices(userId) { let allRecords = []; let nextCursor = ""; let hasMore = true; while (hasMore) { let url = `https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id=${userId}`; if (nextCursor) url += `&cursor=${nextCursor}`; const response = await fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const data = await response.json(); if (data.records && data.records.length > 0) { allRecords = [...allRecords, ...data.records]; } hasMore = data.hasNext; nextCursor = data.cursor; // Break if no more pages or no cursor if (!hasMore || !nextCursor) break; } return allRecords; } ``` {% endtab %} {% tab get_tempolor_music_cloned_voices_example Python %} ``` python import requests token = "API token" user_id = "user_id" cursor = "" # for pagination # Build the URL with query parameters apiUrl = f"https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id={user_id}" if cursor: apiUrl += f"&cursor={cursor}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) result = response.json() print(f"Found {len(result.get('records', []))} cloned voices") # Example of fetching all pages def fetch_all_cloned_voices(user_id): all_records = [] next_cursor = "" has_more = True while has_more: url = f"https://api.useapi.net/v1/tempolor/music/cloned-voices?user_id={user_id}" if next_cursor: url += f"&cursor={next_cursor}" response = requests.get(url, headers=headers) data = response.json() if data.get('records'): all_records.extend(data.get('records')) has_more = data.get('hasNext', False) next_cursor = data.get('cursor', "") # Break if no more pages or no cursor if not has_more or not next_cursor: break return all_records ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-download-job_id === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-download-job_id --- layout: default title: GET music/download/job_id parent: TemPolor API v1 nav_order: 1200 --- ## Download generated music {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves a download URL for a completed music generation job. The `job_id` must be from a successfully completed generation job that can be verified with [GET music/`job_id`](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-job_id). {: .get } > **https://api.useapi.net/v1/tempolor/music/download/`job_id`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `job_id` is **required**. The job returned from a previous [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) or [POST music/instrumental](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental) request. ##### Query Parameters - `file_format` is optional. Specifies the format of the generated music to download. Supported values: * `mp3` - MP3 format (default) * `wav` - WAV format (higher quality) * `stems` - ZIP archive containing separated stems (vocals, instruments, etc.) ##### Responses {% tabs get_tempolor_music_download_job_id_response %} {% tab get_tempolor_music_download_job_id_response 200 %} 200 OK ```json { "url": "https://ugc-cdn.api.instabeat.ai/ai_material/ai_material/mp3/abcdef123456789.mp3?auth_key=1747536678-0-0-9c67b3d5f8a2c41e0d7f6eab3f82fb45", "remainSeconds": 0 } ``` The download URL expires after `remainSeconds` seconds. {% endtab %} {% tab get_tempolor_music_download_job_id_response 400 %} 400 Bad Request ```json { "error": "Generation is not completed yet (0)", "code": 400 } ``` {% endtab %} {% tab get_tempolor_music_download_job_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab get_tempolor_music_download_job_id_response 404 %} 404 Not Found ```json { "error": "No record found for user:12345-tempolor:user_id-job:abcdef123456789", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional url: string remainSeconds: number error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_download_job_id_example %} {% tab get_tempolor_music_download_job_id_example Curl %} ``` bash # Download in MP3 format (default) curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/download/user:12345-tempolor:user_id-job:abcdef123456789 # Download in WAV format (higher quality) curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/download/user:12345-tempolor:user_id-job:abcdef123456789?file_format=wav" # Download stems (separated vocal, instruments, etc.) curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/download/user:12345-tempolor:user_id-job:abcdef123456789?file_format=stems" ``` {% endtab %} {% tab get_tempolor_music_download_job_id_example JavaScript %} ``` javascript const job_id = "user:12345-tempolor:user_id-job:abcdef123456789"; const token = "API token"; const file_format = "mp3"; // or "wav" or "stems" const apiUrl = `https://api.useapi.net/v1/tempolor/music/download/${job_id}?file_format=${file_format}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Download URL:", result.url); // Example of downloading the file async function downloadFile(downloadUrl, fileName) { const fileResponse = await fetch(downloadUrl); const blob = await fileResponse.blob(); // For browser environments const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; a.href = url; a.download = fileName; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); // For Node.js environments // const fs = require('fs'); // const buffer = Buffer.from(await blob.arrayBuffer()); // fs.writeFileSync(fileName, buffer); } // If the request was successful, download the file if (result.url) { const fileName = `tempolor-music-${Date.now()}.${file_format === 'stems' ? 'zip' : file_format}`; await downloadFile(result.url, fileName); } ``` {% endtab %} {% tab get_tempolor_music_download_job_id_example Python %} ``` python import requests import os job_id = "user:12345-tempolor:user_id-job:abcdef123456789" token = "API token" file_format = "mp3" # or "wav" or "stems" apiUrl = f"https://api.useapi.net/v1/tempolor/music/download/{job_id}?file_format={file_format}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) result = response.json() print("Download URL:", result.get("url")) # Example of downloading the file def download_file(download_url, file_name): file_response = requests.get(download_url) with open(file_name, 'wb') as f: f.write(file_response.content) print(f"File downloaded as {file_name}") # If the request was successful, download the file if result.get("url"): if file_format == "stems": file_name = f"tempolor-music-{job_id.split(':')[-1]}.zip" else: file_name = f"tempolor-music-{job_id.split(':')[-1]}.{file_format}" download_file(result.get("url"), file_name) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-job_id === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-job_id --- layout: default title: GET music/job_id parent: TemPolor API v1 nav_order: 1000 --- ## Check music generation status and results {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint checks the status of a previously submitted music generation job. The `job_id` is returned from [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) or [POST music/instrumental](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental). {: .get } > **https://api.useapi.net/v1/tempolor/music/`job_id`** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Path Parameters - `job_id` is **required**. The job returned from a previous [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) or [POST music/instrumental](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental) request. ##### Status Values The response includes a `status` field with the following possible values: | status | status_name | status_final | Description | |--------|-------------|--------------|------------------------------------------| | 0 | GENERATING | False | The music is still being generated | | 10 | FAILED | True | The music generation has failed | | 30 | COMPLETED | True | The music has been successfully generated| When the status is COMPLETED, you can download the music using the [GET music/download/`job_id`](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-download-job_id) endpoint. ##### Responses {% tabs get_tempolor_music_job_id_response %} {% tab get_tempolor_music_job_id_response 200 %} 200 OK
Example Response ```json { "bizType": "ai_material_music", "childType": "lyric_to_material", "matChildType": "lyric_to_material", "sourceType": "sm_user_gen", "itemId": "abcdef123456789", "job_id": "user:12345-tempolor:user_id-job:abcdef123456789", "genItemId": "abcdef123456789", "userId": "user_id", "titleEn": "Epic Orchestral", "cover": "https://example.com/cover.png", "mp3OssId": "ai_material/ai_material/mp3/abcdef123456789.mp3", "wavOssId": "ai_material/ai_material/wav/abcdef123456789.wav", "ossWatermarkMp3": "", "officialPlaylistSong": false, "status": 30, "status_name": "COMPLETED", "status_final": true, "progress": 100, "downloadTotal": 0, "likeTotal": 0, "collectTotal": 0, "musicMaterial": { "style": "Orchestral", "chord": "", "mood": "", "inst": "", "instInfo": "", "scene": "", "otherInfo": "A cinematic orchestral piece with dramatic string sections", "otherInfoCn": "", "key": "F:minor", "bpm": 130, "dur": 180, "seed": 1234567890, "waveformUrl": "https://example.com/waveform.json" }, "readStatus": false, "downloadStatus": false, "createTime": 1716565425000, "updateTime": 1716565700000, "materialQualityScore": 0, "ltmMaterialExtendDto": { "lyricsPrompt": "Sample lyrics here", "description": "A cinematic orchestral piece with dramatic string sections", "ltmVocalModel": false, "ltmMidiModel": false, "genItemId": "abcdef123456789", "prompt": "A cinematic orchestral piece with dramatic string sections", "genMode": 0, "model": "v1-dit-obleck-stereo-zh-en-270-wf", "modelShowName": "v3.5" }, "editType": "gen", "operatorType": "gen", "rootItemId": "abcdef123456789", "parentItemId": "abcdef123456789", "canExtend": true, "canEditLyrics": true, "canFixVocals": true, "canReplaced": false } ```
{% endtab %} {% tab get_tempolor_music_job_id_response 400 %} 400 Bad Request ```json { "error": "job_id has incorrect format", "code": 400 } ``` {% endtab %} {% tab get_tempolor_music_job_id_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab get_tempolor_music_job_id_response 404 %} 404 Not Found ```json { "error": "No record found for user:12345-tempolor:user_id-job:abcdef123456789", "code": 404 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional bizType: string childType: string matChildType: string sourceType: string itemId: string job_id: string genItemId: string userId: string titleEn: string cover: string mp3OssId: string wavOssId: string ossWatermarkMp3: string status: number status_name: string // "GENERATING", "FAILED", "COMPLETED" status_final: boolean progress: number downloadTotal: number likeTotal: number collectTotal: number musicMaterial: { style: string chord: string mood: string inst: string instInfo: string scene: string otherInfo: string otherInfoCn: string key: string bpm: number dur: number seed: number } createTime: number updateTime: number ltmMaterialExtendDto: { lyricsPrompt: string description: string prompt: string genMode: number model: string } editType: string operatorType: string canExtend: boolean error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_job_id_example %} {% tab get_tempolor_music_job_id_example Curl %} ``` bash curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/user:12345-tempolor:user_id-job:abcdef123456789 ``` {% endtab %} {% tab get_tempolor_music_job_id_example JavaScript %} ``` javascript const job_id = "user:12345-tempolor:user_id-job:abcdef123456789"; const token = "API token"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/${job_id}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("response", {response, result}); // Polling example - check status every 10 seconds until completed or failed async function pollJobStatus(job_id) { const apiUrl = `https://api.useapi.net/v1/tempolor/music/${job_id}`; while (true) { const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log(`Job status: ${result.status_name}, Progress: ${result.progress}%`); if (result.status_final) { console.log(`Music generation ${result.status_name.toLowerCase()}`); return result; } // Wait 10 seconds before checking again await new Promise(resolve => setTimeout(resolve, 10000)); } } ``` {% endtab %} {% tab get_tempolor_music_job_id_example Python %} ``` python import requests import time job_id = "user:12345-tempolor:user_id-job:abcdef123456789" token = "API token" apiUrl = f"https://api.useapi.net/v1/tempolor/music/{job_id}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) print(response.status_code, response.json()) # Polling example - check status every 10 seconds until completed or failed def poll_job_status(job_id): apiUrl = f"https://api.useapi.net/v1/tempolor/music/{job_id}" while True: response = requests.get(apiUrl, headers=headers) result = response.json() print(f"Job status: {result.get('status_name')}, Progress: {result.get('progress')}%") if result.get('status_final'): print(f"Music generation {result.get('status_name').lower()}") return result # Wait 10 seconds before checking again time.sleep(10) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-midi === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-midi --- layout: default title: GET music/midi parent: TemPolor API v1 nav_order: 1500 --- ## List MIDI files {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves a list of MIDI files that you've previously uploaded using [POST music/midi](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-midi). These MIDI files can be used as templates for music generation with [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song). {: .get } > **https://api.useapi.net/v1/tempolor/music/midi/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `cursor` is optional. Pagination cursor for fetching additional pages of results. ##### Responses {% tabs get_tempolor_music_midi_response %} {% tab get_tempolor_music_midi_response 200 %} 200 OK ```json { "records": [ { "opType": "upload", "ucid": "user_id", "midiItemId": "user:12345-tempolor:user_id-midi:abcdef123456789", "name": "Piano Composition", "midiUrl": "https://ugc-cdn.api.instabeat.ai/midi/file/abcdef123456789.mid" }, { "opType": "upload", "ucid": "user_id", "midiItemId": "user:12345-tempolor:user_id-midi:fedcba987654321", "name": "Guitar Progression", "midiUrl": "https://ugc-cdn.api.instabeat.ai/midi/file/fedcba987654321.mid" } ], "hasNext": false, "cursor": "" } ``` {% endtab %} {% tab get_tempolor_music_midi_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional records: { opType: string ucid: string midiItemId: string name: string midiUrl: string midiType?: string midiValue?: string }[] hasNext: boolean cursor: string error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_midi_example %} {% tab get_tempolor_music_midi_example Curl %} ``` bash # List all MIDI files curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/midi/?user_id=user_id # Paginate through results using cursor curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/midi/?user_id=user_id&cursor=next_page_cursor_token" ``` {% endtab %} {% tab get_tempolor_music_midi_example JavaScript %} ``` javascript const token = "API token"; const user_id = "user_id"; const cursor = ""; // for pagination // Build the URL with query parameters let apiUrl = `https://api.useapi.net/v1/tempolor/music/midi/?user_id=${user_id}`; if (cursor) apiUrl += `&cursor=${cursor}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log(`Found ${result.records?.length || 0} MIDI files`); // Example of fetching all pages async function fetchAllMidiFiles(userId) { let allRecords = []; let nextCursor = ""; let hasMore = true; while (hasMore) { let url = `https://api.useapi.net/v1/tempolor/music/midi/?user_id=${userId}`; if (nextCursor) url += `&cursor=${nextCursor}`; const response = await fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const data = await response.json(); if (data.records && data.records.length > 0) { allRecords = [...allRecords, ...data.records]; } hasMore = data.hasNext; nextCursor = data.cursor; // Break if no more pages or no cursor if (!hasMore || !nextCursor) break; } return allRecords; } ``` {% endtab %} {% tab get_tempolor_music_midi_example Python %} ``` python import requests token = "API token" user_id = "user_id" cursor = "" # for pagination # Build the URL with query parameters apiUrl = f"https://api.useapi.net/v1/tempolor/music/midi/?user_id={user_id}" if cursor: apiUrl += f"&cursor={cursor}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) result = response.json() print(f"Found {len(result.get('records', []))} MIDI files") # Example of fetching all pages def fetch_all_midi_files(user_id): all_records = [] next_cursor = "" has_more = True while has_more: url = f"https://api.useapi.net/v1/tempolor/music/midi/?user_id={user_id}" if next_cursor: url += f"&cursor={next_cursor}" response = requests.get(url, headers=headers) data = response.json() if data.get('records'): all_records.extend(data.get('records')) has_more = data.get('hasNext', False) next_cursor = data.get('cursor', "") # Break if no more pages or no cursor if not has_more or not next_cursor: break return all_records ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-music --- layout: default title: GET music parent: TemPolor API v1 nav_order: 900 --- ## List music generation jobs {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint retrieves a list of previously generated music items. You can filter the results by type and paginate through them using the cursor parameter. {: .get } > **https://api.useapi.net/v1/tempolor/music/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `type` is optional. Filter results by the type of music generation. Supported values: * `song` - Show music with vocals (default) * `instrumental` - Show instrumental music only - `cursor` is optional. Pagination cursor for fetching additional pages of results. ##### Responses {% tabs get_tempolor_music_response %} {% tab get_tempolor_music_response 200 %} 200 OK
Example Response ```json { "records": [ { "bizType": "ai_material_music", "childType": "lyric_to_material", "matChildType": "lyric_to_material", "sourceType": "sm_user_gen", "itemId": "abcdef123456789", "job_id": "user:12345-tempolor:user_id-job:abcdef123456789", "genItemId": "abcdef123456789", "userId": "user_id", "titleEn": "Epic Orchestral", "cover": "https://example.com/cover.png", "mp3OssId": "ai_material/ai_material/mp3/abcdef123456789.mp3", "wavOssId": "ai_material/ai_material/wav/abcdef123456789.wav", "ossWatermarkMp3": "", "officialPlaylistSong": false, "status": 30, "status_name": "COMPLETED", "status_final": true, "progress": 100, "downloadTotal": 0, "likeTotal": 0, "collectTotal": 0, "musicMaterial": { "style": "Orchestral", "chord": "", "mood": "", "inst": "", "instInfo": "", "scene": "", "otherInfo": "A cinematic orchestral piece with dramatic string sections", "otherInfoCn": "", "key": "F:minor", "bpm": 130, "dur": 180, "seed": 1234567890, "waveformUrl": "https://example.com/waveform.json" }, "readStatus": false, "downloadStatus": false, "createTime": 1716565425000, "updateTime": 1716565700000, "materialQualityScore": 0, "ltmMaterialExtendDto": { "lyricsPrompt": "Sample lyrics here", "description": "A cinematic orchestral piece with dramatic string sections", "ltmVocalModel": false, "ltmMidiModel": false, "genItemId": "abcdef123456789", "prompt": "A cinematic orchestral piece with dramatic string sections", "genMode": 0, "model": "v1-dit-obleck-stereo-zh-en-270-wf", "modelShowName": "v3.5" }, "editType": "gen", "operatorType": "gen", "rootItemId": "abcdef123456789", "parentItemId": "abcdef123456789", "canExtend": true, "canEditLyrics": true, "canFixVocals": true, "canReplaced": false } ], "hasNext": true, "cursor": "next_page_cursor_token" } ```
{% endtab %} {% tab get_tempolor_music_response 400 %} 400 Bad Request ```json { "error": "Invalid type parameter. Must be 'song' or 'instrumental'", "code": 400 } ``` {% endtab %} {% tab get_tempolor_music_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional records: { bizType: string childType: string matChildType: string sourceType: string itemId: string job_id: string genItemId: string userId: string titleEn: string cover: string mp3OssId: string wavOssId: string ossWatermarkMp3: string officialPlaylistSong: boolean status: number status_name: string status_final: boolean progress: number downloadTotal: number likeTotal: number collectTotal: number musicMaterial: { style: string chord: string mood: string inst: string instInfo: string scene: string otherInfo: string otherInfoCn: string key: string bpm: number dur: number seed: number src: string ossSrc: string waveformOssId: string waveformUrl: string batchId: string } readStatus: boolean downloadStatus: boolean createTime: number updateTime: number materialQualityScore: number ltmMaterialExtendDto: { lyricsPrompt: string description: string ltmVocalModel: boolean ltmMidiModel: boolean lrcTimestamp: string genItemId: string prompt: string genMode: number model: string modelShowName: string dynamicModel: string oriCacheDir: string } editType: string operatorType: string rootItemId: string parentItemId: string canExtend: boolean canEditLyrics: boolean canFixVocals: boolean canReplaced: boolean }[] hasNext: boolean cursor: string error: string code: number } ``` ##### Examples {% tabs get_tempolor_music_example %} {% tab get_tempolor_music_example Curl %} ``` bash # List all song generations (default) curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/?user_id=user_id # List only instrumental music curl -H "Authorization: Bearer …" \ https://api.useapi.net/v1/tempolor/music/?user_id=user_id&type=instrumental # Paginate through results using cursor curl -H "Authorization: Bearer …" \ "https://api.useapi.net/v1/tempolor/music/?user_id=user_id&cursor=next_page_cursor_token" ``` {% endtab %} {% tab get_tempolor_music_example JavaScript %} ``` javascript const token = "API token"; const user_id = "user_id"; const type = "song"; // or "instrumental" const cursor = ""; // for pagination // Build the URL with query parameters let apiUrl = `https://api.useapi.net/v1/tempolor/music/?user_id=${user_id}`; if (type) apiUrl += `&type=${type}`; if (cursor) apiUrl += `&cursor=${cursor}`; const response = await fetch(apiUrl, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log(`Found ${result.records?.length || 0} music items`); // Example of fetching all pages async function fetchAllMusicItems(userId, type) { let allRecords = []; let nextCursor = ""; let hasMore = true; while (hasMore) { let url = `https://api.useapi.net/v1/tempolor/music/?user_id=${userId}`; if (type) url += `&type=${type}`; if (nextCursor) url += `&cursor=${nextCursor}`; const response = await fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }); const data = await response.json(); if (data.records && data.records.length > 0) { allRecords = [...allRecords, ...data.records]; } hasMore = data.hasNext; nextCursor = data.cursor; // Break if no more pages or no cursor if (!hasMore || !nextCursor) break; } return allRecords; } ``` {% endtab %} {% tab get_tempolor_music_example Python %} ``` python import requests token = "API token" user_id = "user_id" type_param = "song" # or "instrumental" cursor = "" # for pagination # Build the URL with query parameters apiUrl = f"https://api.useapi.net/v1/tempolor/music/?user_id={user_id}" if type_param: apiUrl += f"&type={type_param}" if cursor: apiUrl += f"&cursor={cursor}" headers = { "Authorization": f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) result = response.json() print(f"Found {len(result.get('records', []))} music items") # Example of fetching all pages def fetch_all_music_items(user_id, type_param=None): all_records = [] next_cursor = "" has_more = True while has_more: url = f"https://api.useapi.net/v1/tempolor/music/?user_id={user_id}" if type_param: url += f"&type={type_param}" if next_cursor: url += f"&cursor={next_cursor}" response = requests.get(url, headers=headers) data = response.json() if data.get('records'): all_records.extend(data.get('records')) has_more = data.get('hasNext', False) next_cursor = data.get('cursor', "") # Break if no more pages or no cursor if not has_more or not next_cursor: break return all_records ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-scheduler-available === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-scheduler-available --- layout: default title: GET scheduler/available parent: TemPolor API v1 nav_order: 2000 --- ## Get available capacity {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Get information about currently executing jobs and available capacity for all configured accounts. {: .get } > **https://api.useapi.net/v1/tempolor/scheduler/available** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs get_TemPolor_scheduler_available_response %} {% tab get_TemPolor_scheduler_available_response 200 %} 200 OK The response contains information about currently executing jobs and available capacity. ```json { "executing": [ { "job_id": "user:12345-tempolor:12345-job:abcdef123456789", "started": "2025-05-15T12:34:56.789Z", "elapsed": "01:23", "replyUrl": "https://example.com/callback", "replyRef": "my-reference" } ], "available": [ { "user_id": "12345", "maxJobs": 10, "executing": 1, "available": 9 }, { "user_id": "67890", "maxJobs": 5, "executing": 0, "available": 5 } ] } ``` {% endtab %} {% tab get_TemPolor_scheduler_available_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { executing: [ // Currently executing jobs { job_id: string started: string // ISO timestamp when the job started elapsed: string // Time elapsed since start in MM:SS format replyUrl?: string // Optional callback URL if specified during job creation replyRef?: string // Optional reference if specified during job creation } ], available: [ // Accounts with available capacity { user_id: string // Account identifier maxJobs: number // Maximum concurrent jobs allowed for this account executing: number // Number of currently executing jobs available: number // Number of available job slots (maxJobs - executing) } ] } ``` ##### Examples {% tabs get_TemPolor_scheduler_available_example %} {% tab get_TemPolor_scheduler_available_example Curl %} ``` bash curl "https://api.useapi.net/v1/tempolor/scheduler/available" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab get_TemPolor_scheduler_available_example JavaScript %} ``` javascript const token = "API token"; const apiUrl = "https://api.useapi.net/v1/tempolor/scheduler/available"; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Scheduler info:", result); // Find account with most available capacity if (result.available && result.available.length > 0) { const bestAccount = result.available[0]; // Sorted by availability console.log(`Best account to use: ${bestAccount.user_id} (${bestAccount.available} slots available)`); } ``` {% endtab %} {% tab get_TemPolor_scheduler_available_example Python %} ``` python import requests token = "API token" api_url = "https://api.useapi.net/v1/tempolor/scheduler/available" headers = { 'Authorization': f'Bearer {token}' } response = requests.get(api_url, headers=headers) result = response.json() print("Scheduler info:", result) # Find account with most available capacity if result.get('available') and len(result['available']) > 0: best_account = result['available'][0] # Sorted by availability print(f"Best account to use: {best_account['user_id']} ({best_account['available']} slots available)") ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-scheduler === Document URL: https://useapi.net/docs/api-tempolor-v1/get-tempolor-scheduler --- layout: default title: GET scheduler parent: TemPolor API v1 nav_order: 1900 --- ## List scheduled jobs {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Get a list of currently executing music generation jobs. {: .get } > **https://api.useapi.net/v1/tempolor/scheduler/** ##### Request Headers ``` yaml Authorization: Bearer {API token} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. ##### Responses {% tabs get_TemPolor_scheduler_response %} {% tab get_TemPolor_scheduler_response 200 %} 200 OK The response contains an array of currently executing music generation jobs. ```json [ { "job_id": "user:12345-tempolor:user_id-job:abcdef123456789", "started": "2025-05-15T12:34:56.789Z", "elapsed": "01:23", "replyUrl": "https://example.com/callback", "replyRef": "my-reference" } ] ``` {% endtab %} {% tab get_TemPolor_scheduler_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript [ { // TypeScript representation of each job job_id: string started: string // ISO timestamp when the job started elapsed: string // Time elapsed since start in MM:SS format replyUrl?: string // Optional callback URL if specified during job creation replyRef?: string // Optional reference if specified during job creation } ] ``` ##### Examples {% tabs get_TemPolor_scheduler_example %} {% tab get_TemPolor_scheduler_example Curl %} ``` bash curl "https://api.useapi.net/v1/tempolor/scheduler/" \ -H "Authorization: Bearer …" ``` {% endtab %} {% tab get_TemPolor_scheduler_example JavaScript %} ``` javascript const token = "API token"; const apiUrl = "https://api.useapi.net/v1/tempolor/scheduler/"; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}` } }); const result = await response.json(); console.log("Current jobs:", result); ``` {% endtab %} {% tab get_TemPolor_scheduler_example Python %} ``` python import requests token = "API token" api_url = "https://api.useapi.net/v1/tempolor/scheduler/" headers = { 'Authorization': f'Bearer {token}' } response = requests.get(api_url, headers=headers) result = response.json() print("Current jobs:", result) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts --- layout: default title: POST accounts parent: TemPolor API v1 nav_order: 100 --- ## Create or update TemPolor API account {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint configures a TemPolor API account with the provided credentials. [Setup TemPolor](../../docs/start-here/setup-tempolor) {: .post } > **https://api.useapi.net/v1/tempolor/accounts** ##### 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 { "requestParams": {}, "maxJobs": 10 } ``` - `requestParams` is **required**, see [Setup TemPolor](../../docs/start-here/setup-tempolor) for details on how to obtain it. - `maxJobs` is optional, the maximum number of concurrent jobs allowed for this account. Default is 10. ##### Responses {% tabs post_tempolor_accounts_response %} {% tab post_tempolor_accounts_response 200 %} 200 OK ```json { "user_id": "123456789", "updated": 1715791234567, "updatedUTC": "2025-05-15T14:30:34.567Z", "maxJobs": 10, "requestParams": {} } ``` {% endtab %} {% tab post_tempolor_accounts_response 400 %} 400 Bad Request ```json { "error": "Parameter requestParams is required", "code": 400 } ``` {% endtab %} {% tab post_tempolor_accounts_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab post_tempolor_accounts_response 402 %} 402 Payment Required ```json { "error": "Subscription required", "code": 402 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript user_id: string updated: number // timestamp in milliseconds updatedUTC: string // ISO date string maxJobs: number requestParams: {} } ``` ##### Examples {% tabs post_tempolor_accounts_example %} {% tab post_tempolor_accounts_example Curl %} ``` bash curl -X POST https://api.useapi.net/v1/tempolor/accounts \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "requestParams": {}, "maxJobs": 10 }' ``` {% endtab %} {% tab post_tempolor_accounts_example JavaScript %} ``` javascript const apiUrl = `https://api.useapi.net/v1/tempolor/accounts`; const api_token = "API token"; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ requestParams: {}, maxJobs: 10 }) }; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_tempolor_accounts_example Python %} ``` python import requests import json apiUrl = "https://api.useapi.net/v1/tempolor/accounts" api_token = "API token" headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_token}" } payload = { "requestParams": {}, "maxJobs": 10 } response = requests.post(apiUrl, headers=headers, data=json.dumps(payload)) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-cloned-voices === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-cloned-voices --- layout: default title: POST music/cloned-voices parent: TemPolor API v1 nav_order: 1700 --- ## Upload voice sample for cloning {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint uploads an audio sample for voice cloning, which can then be used in the [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) endpoint to generate vocals with your cloned voice. [POST raw content using Make.com and similar nocode tools.](../questions-and-answers.html#how-post-raw-content-to-runwaymlassets-and-minimaxfiles-using-makecom-and-similar-nocode-tools) {: .post } > **https://api.useapi.net/v1/tempolor/music/cloned-voices/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: {audio content-type} ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. - `Content-Type` is **required**, select from the table below: | Content-Type | File Extension | | ------------ | -------------- | | audio/mp4 | m4a | | audio/x-m4a | m4a | | audio/mpeg | mp3 | | audio/wav | wav | | audio/wave | wav | | audio/flac | flac | | audio/x-flac | flac | ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `name` is **required**. Specify a name for your cloned voice. ##### Responses {% tabs post_tempolor_music_cloned_voices_response %} {% tab post_tempolor_music_cloned_voices_response 200 %} 200 OK The cloned voice is immediately available to use in [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) by providing the returned `clonedVoiceItemId`. ```json { "result": true, "itemId": "abcdef123456789", "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789" } ``` {% endtab %} {% tab post_tempolor_music_cloned_voices_response 202 %} 202 Accepted The voice cloning process is still in progress. Check back later using [GET music/cloned-voices](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-cloned-voices) to see if the voice is ready. ```json { "itemId": "abcdef123456789", "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789", "message": "Voice cloning is still processing after 120 seconds. Please check back later." } ``` {% endtab %} {% tab post_tempolor_music_cloned_voices_response 400 %} 400 Bad Request ```json { "error": "Empty file received", "code": 400 } ``` {% endtab %} {% tab post_tempolor_music_cloned_voices_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean itemId: string clonedVoiceItemId: string message: string error: string code: number } ``` ##### Examples {% tabs post_tempolor_music_cloned_voices_example %} {% tab post_tempolor_music_cloned_voices_example Curl %} ``` bash curl "https://api.useapi.net/v1/tempolor/music/cloned-voices/?name=my-custom-voice&user_id=" \ -H "Authorization: Bearer …" \ -H "Content-Type: audio/mpeg" \ --data-binary @/path/to/your/voice-sample.mp3 ``` {% endtab %} {% tab post_tempolor_music_cloned_voices_example JavaScript %} ``` javascript const token = "API token"; const user_id = "Previously configured account"; const name = "Your voice name"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/cloned-voices/?name=${name}&user_id=${user_id}`; let blob; /* // Example 1: Fetch audio from URL const audioUrl = "https://example.com/audio-samples/voice-sample.mp3"; const responseAudio = await fetch(audioUrl); blob = await responseAudio.blob(); */ /* // Example 2: Load audio from local file (Node.js) const fs = require('fs'); const audioFileName = "./voice-sample.mp3"; blob = new Blob([fs.readFileSync(audioFileName)]); */ /* // Example 3: Load from input file html element // const audioFile = document.getElementById(`audio-file`); if (audioFile.files[0]) blob = audioFile.files[0]; */ const response = await fetch(apiUrl, { method: "POST", headers: { "Authorization": `Bearer ${token}`, "Content-Type": "audio/mpeg" // Adjust based on your file type }, body: blob }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_tempolor_music_cloned_voices_example Python %} ``` python import requests token = "API token" user_id = "Previously configured account" name = "Your voice name" apiUrl = f"https://api.useapi.net/v1/tempolor/music/cloned-voices/?name={name}&user_id={user_id}" headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'audio/mpeg' # Adjust based on your file type } # # Example 1: Fetch audio from URL # audio_url = "https://example.com/audio-samples/voice-sample.mp3" # response_audio = requests.get(audio_url) # file_content = response_audio.content # # Example 2: Load audio from local file audio_file_path = "./voice-sample.mp3" with open(audio_file_path, 'rb') as audio_file: file_content = audio_file.read() response = requests.post(apiUrl, headers=headers, data=file_content) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-instrumental --- layout: default title: POST music/instrumental parent: TemPolor API v1 nav_order: 700 --- ## Create instrumental music {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint generates instrumental music based on a text prompt and optional musical parameters. {: .post } > **https://api.useapi.net/v1/tempolor/music/instrumental** ##### 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 relaxing lo-fi beat with piano and soft drums", "tonality": "C:major", "bpm": 80, "chords": "C F G Am" } ``` - `user_id` is optional, if not specified, the API will use the account from your request. - `prompt` is **required**, a text description of the desired instrumental music. Maximum length 2000 characters. - `model_instrumental` is optional, the model to use for generation. Supported values: * `i3` - Superior music structure, max 2 min * `i3.5 beta` - Richer arrangements, max 4.5 mins (default) - `tonality` is optional, the musical key for the composition. Supported values: `A:major`, `A:minor`, `Ab:major`, `Ab:minor`, `B:major`, `B:minor`, `Bb:major`, `Bb:minor`, `C#:major`, `C#:minor`, `C:major`, `C:minor`, `D:major`, `D:minor`, `E:major`, `E:minor`, `Eb:major`, `Eb:minor`, `F#:major`, `F#:minor`, `F:major`, `F:minor`, `G:major`, `G:minor` - `bpm` is optional, the tempo in beats per minute. Valid range: 50…190. - `chords` is optional, chord progression for the composition. Maximum length 200 characters. - `replyUrl` is optional, a callback URL that will be called with generation progress updates. Maximum length 1024 characters. We recommend using sites like [webhook.site](https://webhook.site) to test callback URL functionality. - `replyRef` is optional, a reference ID that will be included in the callback requests. Maximum length 1024 characters. - `maxJobs` is optional; it specifies the maximum number of concurrent jobs for this request. If not provided, the value will be taken from the account configuration set in [POST accounts](https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts). ##### Responses {% tabs post_tempolor_music_instrumental_response %} {% tab post_tempolor_music_instrumental_response 200 %} 200 OK Use the returned `jobs` values to retrieve generation status and results using [GET music/`job_id`](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-job_id). If you specify the optional parameter [`replyUrl`](#request-body), the API will call the provided `replyUrl` with generation progress updates until the generation is complete or fails. ```json { "result": true, "itemIds": [ "abcdef123456789", "fedcba987654321" ], "jobs": [ "user:12345-tempolor:user_id-job:abcdef123456789", "user:12345-tempolor:user_id-job:fedcba987654321", ], "remainSeconds": 21533, "maxGenCountAtOnce": 10, "unlimited": false, "remainNum": 1534, "totalNum": 3000 } ``` {% endtab %} {% tab post_tempolor_music_instrumental_response 400 %} 400 Bad Request ```json { "error": "Parameter prompt is required", "code": 400 } ``` {% endtab %} {% tab post_tempolor_music_instrumental_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab post_tempolor_music_instrumental_response 402 %} 402 Payment Required ```json { "error": "Subscription required", "code": 402 } ``` {% endtab %} {% tab post_tempolor_music_instrumental_response 429 %} 429 Too Many Requests Wait in a loop for **at least** 30 seconds and retry again. There are two possible cases for API response 429: 1. API query is full and cannot accept new instrumental music generation requests. Size of queue defined by the `maxJobs` value from either the request body or the default from the account configuration set in [POST accounts](https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts). ```json { "error": "Account is busy executing X jobs", "runningJobs": { "": [ { "user_id": "", "job_id": "", "started": 1715791234567, "replyUrl": "call back URL here, if provided", "replyRef": "reference id here, if provided" } ] }, "code": 429 } ``` 2. The API received an HTTP response status 429 from TemPolor. ```json { "error": "please wait for current Generations to finish or upgrade your plan", "code": 429 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean itemIds: string[] jobs: string[] remainSeconds: number maxGenCountAtOnce: number unlimited: boolean remainNum: number totalNum: number } ``` ##### Examples {% tabs post_tempolor_music_instrumental_example %} {% tab post_tempolor_music_instrumental_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST https://api.useapi.net/v1/tempolor/music/instrumental \ -d '{"prompt": "A relaxing lo-fi beat with piano and soft drums"}' ``` {% endtab %} {% tab post_tempolor_music_instrumental_example JavaScript %} ``` javascript const apiUrl = `https://api.useapi.net/v1/tempolor/music/instrumental`; const api_token = "API token"; const prompt = "A relaxing lo-fi beat with piano and soft drums"; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' } }; data.body = JSON.stringify({ prompt }); const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_tempolor_music_instrumental_example Python %} ``` python import requests apiUrl = f"https://api.useapi.net/v1/tempolor/music/instrumental" api_token = "API token" prompt = "A relaxing lo-fi beat with piano and soft drums" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {api_token}" } body = { "prompt": f"{prompt}" } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-midi === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-midi --- layout: default title: POST music/midi parent: TemPolor API v1 nav_order: 1400 --- ## Upload MIDI file {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint uploads a MIDI file that can be used as a base for music generation in the [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) endpoint. [POST raw content using Make.com and similar nocode tools.](../questions-and-answers.html#how-post-raw-content-to-runwaymlassets-and-minimaxfiles-using-makecom-and-similar-nocode-tools) {: .post } > **https://api.useapi.net/v1/tempolor/music/midi/?...** ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: audio/midi or audio/x-midi ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. - `Content-Type` is **required**, must be `audio/midi` or `audio/x-midi`. ##### Query Parameters - `user_id` is optional when only one [account](https://useapi.net/docs/api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. - `name` is **required**. Specify a name for your MIDI file. ##### Responses {% tabs post_tempolor_music_midi_response %} {% tab post_tempolor_music_midi_response 200 %} 200 OK The MIDI file is immediately available to use in [POST music/song](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song) by providing the returned `midiItemId`. ```json { "isFirst": false, "midiRenderVO": { "opType": "upload", "ucid": "100198329", "midiItemId": "user:12345-tempolor:user_id-midi:abcdef123456789", "name": "my background music", "midiUrl": "https://..." } } ``` {% endtab %} {% tab post_tempolor_music_midi_response 400 %} 400 Bad Request ```json { "error": "Content-Type must be audio/midi or audio/x-midi", "code": 400 } ``` {% endtab %} {% tab post_tempolor_music_midi_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional isFirst: boolean midiRenderVO: { opType: string ucid: string midiItemId: string name: string midiUrl: string } error: string code: number } ``` ##### Examples {% tabs post_tempolor_music_midi_example %} {% tab post_tempolor_music_midi_example Curl %} ``` bash curl "https://api.useapi.net/v1/tempolor/music/midi/?name=my-background-music&user_id=" \ -H "Authorization: Bearer …" \ -H "Content-Type: audio/midi" \ --data-binary @/path/to/your/background-music.mid ``` {% endtab %} {% tab post_tempolor_music_midi_example JavaScript %} ``` javascript const token = "API token"; const user_id = "Previously configured account"; const name = "my-background-music"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/midi/?name=${name}&user_id=${user_id}`; let blob; /* // Example 1: Fetch MIDI from URL const midiUrl = "https://example.com/midi-files/background-music.mid"; const responseMidi = await fetch(midiUrl); blob = await responseMidi.blob(); */ /* // Example 2: Load MIDI from local file (Node.js) const fs = require('fs'); const midiFileName = "./background-music.mid"; blob = new Blob([fs.readFileSync(midiFileName)], { type: "audio/midi" }); */ /* // Example 3: Load from input file html element // const midiFile = document.getElementById(`midi-file`); if (midiFile.files[0]) blob = midiFile.files[0]; */ const response = await fetch(apiUrl, { method: "POST", headers: { "Authorization": `Bearer ${token}`, "Content-Type": "audio/midi" }, body: blob }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_tempolor_music_midi_example Python %} ``` python import requests token = "API token" user_id = "Previously configured account" name = "my-background-music" apiUrl = f"https://api.useapi.net/v1/tempolor/music/midi/?name={name}&user_id={user_id}" headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'audio/midi' } # # Example 1: Fetch MIDI from URL # midi_url = "https://example.com/midi-files/background-music.mid" # response_midi = requests.get(midi_url) # file_content = response_midi.content # # Example 2: Load MIDI from local file midi_file_path = "./background-music.mid" with open(midi_file_path, 'rb') as midi_file: file_content = midi_file.read() response = requests.post(apiUrl, headers=headers, data=file_content) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-song --- layout: default title: POST music/song parent: TemPolor API v1 nav_order: 600 --- ## Create music with vocals {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- This endpoint generates a complete song with vocals based on a text prompt and optional parameters. {: .post } > **https://api.useapi.net/v1/tempolor/music/song** ##### 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 cinematic orchestral piece with dramatic string sections and a powerful crescendo", "lyrics": "These are the lyrics for my song\nSecond line of the lyrics", "clonedVoiceItemId": "user:12345-tempolor:user_id-voice:abcdef123456789", "replyUrl": "https://your-callback-url.com", "replyRef": "your-reference-id" } ``` - `user_id` is optional, if not specified, the API will use the account from your request. - `prompt` is **required**, a text description of the desired song. Maximum length 2000 characters. - `lyrics` is optional, custom lyrics for the song. If not provided, lyrics will be auto-generated based on the prompt. Maximum length 3000 characters. - `model_song` is optional, the model to use for generation. Supported values: * `v3` - Enhanced AI music generation supporting EN/CN/JP, max 2 min * `v3.5` - Supporting EN/CN, max 4.5 min (default) - `artistVoiceItemId` is optional, ID of a predefined artist voice to use for the vocals. Get available voices using [GET artist-voices](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-artist-voices). - `clonedVoiceItemId` is optional, ID of a previously cloned voice to use for the vocals. - To get existing cloned voices, use [GET cloned-voices](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-cloned-voices). - To create a new cloned voice, upload an audio sample using [POST cloned-voices](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-cloned-voices). - `midiItemId` is optional, ID of a previously uploaded MIDI file to base the composition on. - To get existing MIDI files, use [GET midi](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-midi). - To upload a new MIDI file, use [POST midi](https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-midi). - `replyUrl` is optional, a callback URL that will be called with generation progress updates. Maximum length 1024 characters. We recommend using sites like [webhook.site](https://webhook.site) to test callback URL functionality. - `replyRef` is optional, a reference ID that will be included in the callback requests. Maximum length 1024 characters. - `maxJobs` is optional; it specifies the maximum number of concurrent jobs for this request. If not provided, the value will be taken from the account configuration set in [POST accounts](https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts). **Important notes:** - You can only use one of `artistVoiceItemId` or `clonedVoiceItemId`, not both. - If you specify a `midiItemId`, you cannot use `artistVoiceItemId` or `clonedVoiceItemId`. ##### Responses {% tabs post_tempolor_music_song_response %} {% tab post_tempolor_music_song_response 200 %} 200 OK Use the returned `jobs` values to retrieve generation status and results using [GET music/`job_id`](https://useapi.net/docs/api-tempolor-v1/get-tempolor-music-job_id). If you specify the optional parameter [`replyUrl`](#request-body), the API will call the provided `replyUrl` with generation progress updates until the generation is complete or fails. ```json { "result": true, "itemIds": [ "abcdef123456789", "fedcba987654321" ], "jobs": [ "user:12345-tempolor:user_id-job:abcdef123456789", "user:12345-tempolor:user_id-job:fedcba987654321", ], "remainSeconds": 21533, "maxGenCountAtOnce": 10, "unlimited": false, "remainNum": 1534, "totalNum": 3000 } ``` {% endtab %} {% tab post_tempolor_music_song_response 400 %} 400 Bad Request ```json { "error": "Parameter prompt is required", "code": 400 } ``` {% endtab %} {% tab post_tempolor_music_song_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% tab post_tempolor_music_song_response 402 %} 402 Payment Required ```json { "error": "Subscription required", "code": 402 } ``` {% endtab %} {% tab post_tempolor_music_song_response 404 %} 404 Not Found ```json { "error": "The source material does not exist.", "code": 404 } ``` This error may occur if the specified `artistVoiceItemId`, `clonedVoiceItemId`, or `midiItemId` no longer exists. {% endtab %} {% tab post_tempolor_music_song_response 429 %} 429 Too Many Requests Wait in a loop for **at least** 30 seconds and retry again. There are two possible cases for API response 429: 1. API query is full and cannot accept new music generation requests. Size of queue defined by the `maxJobs` value from either the request body or the default from the account configuration set in [POST accounts](https://useapi.net/docs/api-tempolor-v1/post-tempolor-accounts). ```json { "error": "Account is busy executing X jobs", "runningJobs": { "": [ { "user_id": "", "job_id": "", "started": 1715791234567, "replyUrl": "call back URL here, if provided", "replyRef": "reference id here, if provided" } ] }, "code": 429 } ``` 2. The API received an HTTP response status 429 from TemPolor. ```json { "error": "please wait for current Generations to finish or upgrade your plan", "code": 429 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional result: boolean itemIds: string[] jobs: string[] remainSeconds: number maxGenCountAtOnce: number unlimited: boolean remainNum: number totalNum: number } ``` ##### Examples {% tabs post_tempolor_music_song_example %} {% tab post_tempolor_music_song_example Curl %} ``` bash curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST https://api.useapi.net/v1/tempolor/music/song \ -d '{"prompt": "A cinematic orchestral piece with dramatic string sections"}' ``` {% endtab %} {% tab post_tempolor_music_song_example JavaScript %} ``` javascript const apiUrl = `https://api.useapi.net/v1/tempolor/music/song`; const api_token = "API token"; const prompt = "A cinematic orchestral piece with dramatic string sections"; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' } }; data.body = JSON.stringify({ prompt }); const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_tempolor_music_song_example Python %} ``` python import requests apiUrl = f"https://api.useapi.net/v1/tempolor/music/song" api_token = "API token" prompt = "A cinematic orchestral piece with dramatic string sections" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {api_token}" } body = { "prompt": f"{prompt}" } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json()) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-stems-splitter === Document URL: https://useapi.net/docs/api-tempolor-v1/post-tempolor-music-stems-splitter --- layout: default title: POST music/stems-splitter parent: TemPolor API v1 nav_order: 800 --- ## Split audio into stems {: .no_toc } May 15, 2025 ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Upload an audio file (MP3, WAV, M4A, FLAC) and split it into separate instrument stems (vocals, drums, bass, etc). [POST raw content using Make.com and similar nocode tools.](../questions-and-answers.html#how-post-raw-content-to-runwaymlassets-and-minimaxfiles-using-makecom-and-similar-nocode-tools) {: .post } > **https://api.useapi.net/v1/tempolor/music/stems-splitter/?…** ##### Request Headers ``` yaml Authorization: Bearer {API token} Content-Type: select from the table below ``` - `API token` is **required**, see [Setup useapi.net](../start-here/setup-useapi) for details. - `Content-Type` is **required**, select from the table below: | Content-Type | File Extension | | ------------ | -------------- | | audio/mpeg | mp3 | | audio/wav | wav | | audio/wave | wav | | audio/mp4 | m4a | | audio/x-m4a | m4a | | audio/flac | flac | | audio/x-flac | flac | ##### Query Parameters - `user_id` is optional when only one [account](../api-tempolor-v1/get-tempolor-accounts) configured. However, if you have multiple accounts configured, this parameter becomes **required**. ##### Responses {% tabs post_TemPolor_music_stems_splitter_response %} {% tab post_TemPolor_music_stems_splitter_response 200 %} 200 OK When the response includes `stemsZipUrl`, the processing is complete and you can download the ZIP file containing the separated stems. ```json { "state": 2, "title": "audio_file.mp3", "stemsZipUrl": "https://example.com/path/to/stems.zip" } ``` {% endtab %} {% tab post_TemPolor_music_stems_splitter_response 400 %} 400 Bad Request The server encountered an error processing your request. ```json { "error": "", "code": 400 } ``` {% endtab %} {% tab post_TemPolor_music_stems_splitter_response 401 %} 401 Unauthorized ```json { "error": "Unauthorized", "code": 401 } ``` {% endtab %} {% endtabs %} ##### Model ```typescript { // TypeScript, all fields are optional state: number title: string stemsZipUrl: string // URL to download the zip with separated stems audioType: string detail: string[] error: string code: number } ``` ##### Examples {% tabs post_TemPolor_music_stems_splitter_example %} {% tab post_TemPolor_music_stems_splitter_example Curl %} ``` bash curl "https://api.useapi.net/v1/tempolor/music/stems-splitter/?user_id=" \ -H "Authorization: Bearer …" \ -H "Content-Type: audio/mpeg" \ --data-binary @/path/to/your/audio-track.mp3 ``` {% endtab %} {% tab post_TemPolor_music_stems_splitter_example JavaScript %} ``` javascript const token = "API token"; const user_id = "Previously configured account"; const apiUrl = `https://api.useapi.net/v1/tempolor/music/stems-splitter/?user_id=${user_id}`; let blob; /* // Example 1: Fetch audio from URL const audioUrl = "https://example.com/path/to/audio-track.mp3"; const responseAudio = await fetch(audioUrl); blob = await responseAudio.blob(); */ /* // Example 2: Load audio from local file (Blob) const fsp = require('fs').promises; const audioFileName = "./audio-track.mp3"; blob = new Blob([await fsp.readFile(audioFileName)]); */ /* // Example 3: Load from input file html element // const audioFile = document.getElementById(`audio-file`); if (audioFile.files[0]) blob = audioFile.files[0]; */ // Upload the audio file for stem splitting const response = await fetch(apiUrl, { method: "POST", headers: { "Authorization": `Bearer ${token}`, "Content-Type": "audio/mpeg" }, body: blob }); const result = await response.json(); console.log("response", {response, result}); ``` {% endtab %} {% tab post_TemPolor_music_stems_splitter_example Python %} ``` python import requests import time token = "API token" user_id = "Previously configured account" apiUrl = f"https://api.useapi.net/v1/tempolor/music/stems-splitter/?user_id={user_id}" headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'audio/mpeg' } # # Example 1: Fetch audio from URL # import requests # audio_url = "https://example.com/path/to/audio-track.mp3" # response_audio = requests.get(audio_url) # file_content = response_audio.content # # Example 2: Load audio from local file audio_file_path = "./audio-track.mp3" with open(audio_file_path, 'rb') as audio_file: file_content = audio_file.read() response = requests.post(apiUrl, headers=headers, data=file_content) result = response.json() print(response.status_code, result) ``` {% endtab %} {% endtabs %} === URL: https://useapi.net/docs/questions-and-answers === Document URL: https://useapi.net/docs/questions-and-answers --- title: Q&A nav_order: 110000 layout: home --- # Questions and Answers {: .no_toc } 4 min read • September 2023 (January 14, 2026) ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- ### How to avoid Midjourney bans? Using automation is against Discord and Midjourney's Terms of Service, so you need to plan accordingly and have backup account(s) ready. * The best practice is to create several new Discord accounts and join the Midjourney Discord server. These accounts should be used exclusively for API work and nothing else. We strongly recommend using a VPN to prevent your personal data/IP addresses from being leaked. You can use the [Opera](https://www.opera.com/download) browser with built-in VPN or the [Brave](https://brave.com/download) browser with [Tor support](https://support.brave.com/hc/en-us/articles/360018121491-What-is-a-Private-Window-with-Tor-Connectivity). * Brand new/fresh Discord accounts have a significantly higher chance of being banned when running high Midjourney generation loads. Consider purchasing aged Discord accounts (2-3 years old) from marketplaces like [z2u.com](https://www.z2u.com/) for around $1-3 each. Aged accounts appear more legitimate and are less likely to trigger automated bans. * When creating accounts in bulk, make sure to restart Opera/Brave so that your IP is different every time, since Discord tracks and records the IP addresses used to create new accounts. Make sure to log in to the Discord accounts designated for API use through a VPN. When creating new email and Discord accounts, use names closely resembling real names - something that does not look suspicious. * Once a Discord account is created, join the Midjourney Discord [server](https://discord.com/invite/midjourney) and follow the [instructions](https://useapi.net/docs/start-here/setup-midjourney) to create your own server and invite the Midjourney bot. If you're planning to use this account, you can proceed with a Midjourney subscription. It's a good idea to create several Discord accounts with the Midjourney setup, as described above early on, this will *"age"* them and make them less suspicious later on when you need to subscribe to Midjourney. * When paying for a Midjourney subscription use a virtual credit card number (provided by most major credit card companies) or services like [Privacy.com](https://privacy.com). Make sure to use a credit card name and address that resemble an actual address and name. Use a *different name and address* for every new Midjourney subscription. Midjourney has access to all payment details and will cross-check banned accounts' payment information to ban newly created accounts if a match is found. * If your account gets banned, file a charge dispute with your credit card company. Since Midjourney cannot produce any evidence of you violating the ToS, the bank will fully refund your payment. Our customers have reported a 100% success rate of getting their money back, though it may take some time. * When using the API, try to simulate real users. Avoid running generations 24/7 by establishing quiet hours (for example, you can use two or three accounts and rotate them every 12/8 hours). Midjourney seems to specifically target accounts with a large number of `--relax` usage, so try to limit those generations to a reasonable number (<300 generations/day). If you heavily rely on `--relax`, execute at least one fast generation for every NN relax generations. * Do not post public links to Discord/Midjourney CDN attachments, they contain your Discord account number and can be used to trace back to your account. * Sharing cross-account `--p` codes is not safe. You risk all accounts using the same `--p` codes being banned by Midjourney. * Do not run multiple requests with the same or similar prompts (e.g., "My test prompt 1", "My test prompt 2", and so on). Midjourney analyzes prompts and will force your Discord account token to expire when this kind of situation is detected. You will have to reset your Discord password manually before you can continue operating. * Adjust [maxJobs](../docs/api-v2/post-account-midjourney) parameter to be one less than the maximum possible. For example, for the [Pro Plan](https://docs.midjourney.com/docs/plans) with a maximum of 12 concurrent jobs, set `maxJobs` to 11 or even 10. * If you ever receive a [504](../docs/api-v2/post-jobs-imagine#responses) response code, it means your `maxJobs` is set to a value higher than your account plan supports. Adjust it accordingly. * Finally, monitor for [596](../docs/api-v2/post-jobs-imagine#responses) response codes and ensure you check your API email. The API will proactively warn you if you have pending moderation messages or if Midjourney issues a CAPTCHA request. ### How to avoid Runway account suspension? Using automation is against Runway's Terms of Service, so you need to plan accordingly and have backup account(s) ready. * The best practice is to create several stand-by Runway accounts. These accounts should be used exclusively for API work and nothing else. We strongly recommend using a VPN to prevent your personal data/IP addresses from being leaked. You can use the [Opera](https://www.opera.com/download) browser with a built-in VPN or the [Brave](https://brave.com/download) browser with [Tor support](https://support.brave.com/hc/en-us/articles/360018121491-What-is-a-Private-Window-with-Tor-Connectivity). * When creating accounts in bulk, make sure to restart Opera/Brave so that your IP is different every time. When creating new emails and Runway accounts, use names that closely resemble real names—something that does not look suspicious. * Once a new Runway account is created, you will have a few free credits with which you can test the API. After testing, log out and leave the account alone until you are ready to activate the [Unlimited plan](https://runwayml.com/pricing) (the only subscription plan that makes sense to pay for). * When paying for a Runway subscription, use a virtual credit card number (provided by most major credit card companies) or services like [Privacy.com](https://privacy.com). Make sure to use a credit card name and address that resemble an actual name and address. Use a *different name and address* for every new Runway subscription. Runway has access to all payment details and can cross-check banned accounts' payment information to ban newly created accounts if a match is found. * If your account gets suspended, file a charge dispute with your credit card company. Since Runway cannot produce any evidence of you violating the ToS, the bank will fully refund your payment. Our customers have reported a 100% success rate of getting their money back, though it may take some time. * When using the API, try to simulate real users. Avoid running generations 24/7 by establishing quiet hours (for example, you can use two or three accounts and rotate them every 12 to 8 hours). Avoid calling API endpoints too frequently, and consider using the `replyUrl` webhook to retrieve results, as this will ensure the least intrusive operation. * Finally, monitor your API email—the one you used to subscribe to useapi.net services. The API will proactively warn you if your Runway account has any issues. ### Do you validate a user's text/image prompts to ensure they are passing AI services' safety requirements? It is common practice for AI services to ban users for violating prompt guidelines (for example, see Midjourney PG13 [requirements](https://docs.midjourney.com/docs/community-guidelines)). Our API does not perform any prompt pre-validations, it will return a [422](../docs/api-v2/post-jobs-imagine#responses) status code if the job is moderated by Midjourney, and similar checks apply for the other AI APIs we offer. Generally speaking, if you're planning to use the API for a public Telegram bot (which is one of the popular use cases) or in similar scenarios where you do not control the quality of the prompt, it might be a good idea to use a combination of a ban/stop word list along with [OpenAI ChatGPT](https://openai.com/api/pricing) or [Google Gemini](https://ai.google.dev/pricing) to check if the prompts meet safety requirements. [Gemini](https://ai.google.dev/pricing) offers a free tier with some RPM (requests per minute) limitations. We also offer LLM models, specifically `MiniMax-Text-01`, a fast instructional multimodal model that is free to use and can validate both text and images for safety. Please see [POST minimax/llm](../docs/api-minimax-v1/post-minimax-llm). ### How is your experimental Runway API different from the official Runway API? Official [Runway API](https://docs.dev.runwayml.com) currently only supports Gen-3 Alpha Turbo. The cost for Gen-3 Alpha Turbo 10-second generation is [$0.50](https://docs.dev.runwayml.com/usage/billing). Our [experimental Runway API](https://useapi.net/docs/api-runwayml-v1) is a reverse-engineered version of [runwayml.com](https://runwayml.com). It fully supports **all** features of Gen-3 Alpha, Gen-3 Alpha Turbo, Act-One, Video to Video, Super-Slow Motion, Gen-2, the LipSync feature, and [more](https://useapi.net/docs/api-runwayml-v1). When used along with the Runway [Unlimited plan](https://runwayml.com/pricing), it allows you to run several hundred generations each day. On average, you can expect the following numbers for Gen-3 Alpha Turbo 10-second generation: - 1 generation is completed within 25 seconds - 10 generations take about 4 minutes to complete - 30 generations take about 12 minutes to complete - 150 generations take about one hour to complete If you generate 200+ videos, the official API will cost you $0.50 per generation, so 200 generations cost about $100. This means the $95 [Unlimited plan](https://runwayml.com/pricing), combined with our $15/month subscription, will pay for itself by the **first day**, most often within the first few hours. We provide an API for all the features available at [runwayml.com](https://runwayml.com), including Gen-3 Alpha, Act-One, video-to-video (with extend and expand), Frames, and many more. The official Runway API only supports [Gen-3 Alpha Turbo](https://docs.dev.runwayml.com/). ### How is your experimental MiniMax API different from the official MiniMax API? Official [MiniMax API](https://intl.minimaxi.com/document/video_generation) costs $0.43…$0.65 [link](https://www.minimaxi.com/en/price) per single 6-second-long generation. Our [experimental MiniMax API](https://useapi.net/docs/api-minimax-v1) is a reverse-engineered version of the MiniMax/HailuoAI websites. It does not cost you anything to generate as many videos as you wish, thanks to a flat monthly [subscription](https://useapi.net/docs/subscription) fee. You can link as many [paid](https://hailuoai.video/subscribe) or free MiniMax/HailuoAI accounts to our API as you wish. With [Unlimited](https://hailuoai.video/subscribe) Hailuo AI plan or [Standard](https://hailuoai.video/subscribe) plan for first day, you can expect the following numbers: - 1 generation completed within 2 minutes - 10 generations take about 20 minutes to complete - 30 generations take about an hour to complete If you generate 250+ videos, the official API will cost you $0.43 per generation, so 250 generations total about $107.50. This means the $95 [Unlimited](https://hailuoai.video/subscribe) plan, combined with our $15/month subscription, will pay for itself by the **first day**. When using free [hailuoai.video](https://hailuoai.video) account, it costs one credit to generate a single image, and you can generate up to four images at once. With a daily free top-up of 100 credits, a free hailuoai.video account can generate 100 images per day – up to 3K images per month. ### Do you support [n8n](https://n8n.io) workflow automation? Please consider the [n8n-nodes-useapi](https://github.com/lvalics/n8n-nodes-useapi) package by [lvalics](https://github.com/lvalics). ### How POST raw content to [runwayml/assets](https://useapi.net/docs/api-runwayml-v1/post-runwayml-assets) and [minimax/files](https://useapi.net/docs/api-minimax-v1/post-minimax-files) using Make.com and similar nocode tools? We recommend using module called [0codekit](https://www.make.com/en/integrations/onesaas) to run JavaScript and return a result.
0codekit JavaScript example ```js async function fetchFromURLandPOST(imageURL, name) { const apiToken = ""; // https://useapi.net/docs/start-here/setup-useapi // Runway https://useapi.net/docs/api-runwayml-v1/post-runwayml-assets const apiUrl = `https://api.useapi.net/v1/runwayml/assets/?name=${name}`; // MiniMax https://useapi.net/docs/api-minimax-v1/post-minimax-files // const apiUrl = `https://api.useapi.net/v1/minimax/files/`; try { // Fetch the image from the URL const responseImage = await fetch(imageURL); if (!responseImage.ok) throw new Error(`Failed to fetch ${imageURL}: ${responseImage.statusText}`); // Convert the response to a Blob const blob = await responseImage.blob(); // Prepare headers for the POST request const headers = { "Authorization": `Bearer ${apiToken}`, "Content-Type": blob.type, }; // Make the POST request with the blob as the body const response = await fetch(apiUrl, { method: "POST", headers: headers, body: blob, }); const result = await response.json(); return { data: result }; } catch (error) { return { error: error.message }; } } // Calling the function result = await fetchFromURLandPOST("https:\\website.com\image.jpeg", "my_image"); ```