Skip to main content

1. Get your API key

Before you call any API, you need a TT-API-KEY.

Step 1: Create your account

Go to TTAPI or open the TTAPI Dashboard. You can sign in with GitHub or Google.
After your account is created, TTAPI generates a default TT-API-KEY. This key is used across all TTAPI endpoints.New accounts also receive 30 quota (about $0.30) in trial credit.

Step 2: Basic account setup

For security, we recommend rotating the default key before production use. You can reset it directly from the dashboard homepage.
If you do not want to rely on GitHub or Google login later, use Forgot password? on the login page and set a password for your TTAPI account.

2. Add the request header

All requests must include your API key in the header:
TT-API-KEY: YOUR_API_KEY

3. Send your first request

Step 1: Submit a generation request

The example below creates a Midjourney image task.
curl --request POST \
  --url https://api.ttapi.io/midjourney/v1/imagine \
  --header 'Content-Type: application/json' \
  --header 'TT-API-KEY: YOUR_API_KEY' \
  --data '
{
  "prompt": "A cute kitten",
  "mode": "fast",
  "hookUrl": "<string>"
}
'

Sample response

{
  "status": "SUCCESS",
  "message": "success",
  "data": {
    "jobId": "b8bd3ff0-4349-4b71-8938-5e13aefa64fe"
  }
}

Step 2: Fetch the task result

Use the returned jobId to poll the result:
curl -X GET "https://api.ttapi.io/midjourney/v1/fetch?jobId={jobId}" \
  -H "TT-API-KEY: YOUR_API_KEY"

Sample response

{
  "status": "SUCCESS",
  "message": "",
  "jobId": "8ddd973f-b5ff-4192-b418-b37fb65c65f3",
  "data": {
    "action": "imagine",
    "jobId": "8ddd973f-b5ff-4192-b418-b37fb65c65f3",
    "progress": "100",
    "prompt": "A cute kitten",
    "quota": "2",
    "discordImage": "https://cdn.ttapi.io/midjourney/2025-11-14/20260307_024522_19cf9806e1c7438b.png",
    "cdnImage": "https://cdn.ttapi.io/midjourney/2025-11-14/20260307_024522_19cf9806e1c7438b.png",
    "width": 960,
    "height": 1200,
    "hookUrl": "https://webhook-test.com/40bb50795afa242aee8c837617cd72e9",
    "components": [
      "upsample1", "upsample2", "upsample3", "upsample4", "reroll", "variation1", "variation2", "variation3", "variation4"
    ],
    "seed": null,
    "images": [
      "https://cdn.ttapi.io/midjourney/20260307/5c7261ec-7271-495d-a0f7-4dd395652a84tl.png",
      "https://cdn.ttapi.io/midjourney/20260307/5c7261ec-7271-495d-a0f7-4dd395652a84tr.png",
      "https://cdn.ttapi.io/midjourney/20260307/5c7261ec-7271-495d-a0f7-4dd395652a84bl.png",
      "https://cdn.ttapi.io/midjourney/20260307/5c7261ec-7271-495d-a0f7-4dd395652a84br.png"
    ]
  }
}

Task statuses

StatusMeaning
PENDING_QUEUEWaiting in queue
ON_QUEUEBeing processed
SUCCESSCompleted successfully
FAILEDFailed

Need help?

Last modified on April 13, 2026