Create instrumental music

May 15, 2025 (November 22, 2026)

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

This endpoint generates instrumental music based on a text prompt and optional musical parameters.

https://api.useapi.net/v1/tempolor/music/instrumental

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
  "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:
    • i4 - Better musicality and prompt adherence (default)

    Older model names are still accepted and automatically routed to i4.

  • 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 to test callback URL functionality. Callback body has the same JSON shape as GET /music/job_id response.
    A job that has not completed within 60 minutes ends with a final callback with code 408 and status_name FAILED.

  • 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.
Responses
  • 200 OK

    Use the returned jobs values to retrieve generation status and results using GET music/job_id.

    If you specify the optional parameter replyUrl, the API will call the provided replyUrl with generation progress updates until the generation is complete or fails.

    {
      "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
    }
    
  • 400 Bad Request

    {
      "error": "Parameter prompt is required",
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 402 Payment Required

    {
      "error": "Subscription required",
      "code": 402
    }
    
  • 418 I’m a teapot

    TemPolor created the tracks, but scheduling them for status updates failed. jobs lists the tracks that already exist at TemPolor: read each one with GET music/job_id instead of submitting the request again, which would make them twice.

    {
      "error": "<Error message>",
      "code": 418,
      "jobs": [
        "user:12345-tempolor:user_id-job:abcdef123456789",
        "user:12345-tempolor:user_id-job:fedcba987654321"
      ]
    }
    
  • 422 Unprocessable Content

    TemPolor content moderation rejected the prompt. Resubmitting the same text will be rejected again, so change the prompt before retrying.

    {
      "error": "TemPolor content moderation rejected the prompt. Resubmitting the same text will be rejected again. (430002)"
    }
    
  • 429 Too Many Requests

    There are three possible cases for API response 429. In the first two, wait in a loop for at least 30 seconds and retry again.

    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.
      {
        "error": "Account <user_id> is busy executing X jobs",
        "runningJobs": {
       "<user_id>": [
         {
           "user_id": "<user_id>",
           "job_id": "<job_id>",
           "started": 1715791234567,
           "replyUrl": "call back URL here, if provided",
           "replyRef": "reference id here, if provided"
         }
       ]
        },
        "code": 429
      }
      
    2. TemPolor asks to wait for the account’s current generations to finish (code 500002).
      {
        "error": "please wait for current Generations to finish or upgrade your plan (500002)"
      }
      
    3. TemPolor refused more songs on the account today.

    TemPolor can refuse more songs on an account for the rest of the UTC day, even on Ultra, which it sells with unlimited tracks: it has happened after about 300 songs in a day. TemPolor answers "unlimited gen!" (code 400204), and the API answers 429 at once and pauses that account for 30 minutes, never past 00:00 UTC, then pauses it again if TemPolor still refuses. Requests without user_id go to your other connected accounts meanwhile (a song with clonedVoiceItemId or midiItemId runs on the account that holds it, so it gets the 429 too), and a request that names the paused account with user_id gets the same 429. Don’t retry before benchedUntil (the Retry-After header gives the seconds to wait). To make more songs today, connect another TemPolor account with POST accounts (each useapi.net subscription connects 3), or wait for 00:00 UTC, when TemPolor’s limit resets.

    {
      "error": "TemPolor refused more songs on account 12345 today: \"unlimited gen!\" (400204). This account is paused until 2026-11-21T18:30:00.000Z; requests without user_id use your other connected accounts. TemPolor's limit resets at 00:00 UTC.",
      "benchedUntil": "2026-11-21T18:30:00.000Z",
      "code": 429
    }
    

    When every connected account that is not signed out is paused, benched lists when each one comes back, and benchedUntil is the first of them.

    {
      "error": "TemPolor refused more songs today on every healthy connected account: \"unlimited gen!\" (400204). The first account comes back at 2026-11-21T18:30:00.000Z; connect another TemPolor account to keep going. TemPolor's limit resets at 00:00 UTC.",
      "benchedUntil": "2026-11-21T18:30:00.000Z",
      "benched": {
        "12345": "2026-11-21T18:30:00.000Z",
        "67890": "2026-11-21T18:41:12.000Z"
      },
      "code": 429
    }
    

    GET scheduler/available and GET accounts show the paused accounts with their benchedUntil.

  • 596 Account signed out

    TemPolor signed the account out, so its session ticket no longer works. The API stops using the account until you add it again with fresh credentials at POST accounts, see Setup TemPolor. Requests without user_id use your other accounts in the meantime.

    {
      "error": "TemPolor signed out account 101441809 (You are currently logged out (400006)). Add it again with POST /v1/tempolor/accounts using fresh credentials, see https://useapi.net/docs/start-here/setup-tempolor",
      "code": 596
    }
    

    If every account you have is in this state, a request without user_id returns 596 as well.

Model

The new music jobs: poll each id in jobs with GET music/job_id until it finishes.

The new music jobs, field by field
{   // TypeScript, all fields are optional
    result: boolean
    itemIds: string[]
    jobs: string[]
    remainSeconds: number
    maxGenCountAtOnce: number
    unlimited: boolean
    remainNum: number
    totalNum: number
}
Examples
  • 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"}'
    
  • 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});
    
  • 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())
    
Try It