Skip to main content
POST
/
grok
/
image
/
fetch
cURL
curl --request POST \
  --url https://api.ttapi.io/grok/image/fetch \
  --header 'TT-API-KEY: <api-key>'
import requests

url = "https://api.ttapi.io/grok/image/fetch"

headers = {"TT-API-KEY": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'TT-API-KEY': '<api-key>'}};

fetch('https://api.ttapi.io/grok/image/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ttapi.io/grok/image/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"TT-API-KEY: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.ttapi.io/grok/image/fetch"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("TT-API-KEY", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.ttapi.io/grok/image/fetch")
.header("TT-API-KEY", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ttapi.io/grok/image/fetch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "status": "SUCCESS",
  "message": "success",
  "jobId": "9e73af91-6fe4-4833-9005-b63cb741619d",
  "data": {
    "prompt": "A cute little cat",
    "n": 1,
    "aspectRatio": "1:1",
    "images": [
      "https://cdn.ttapi.io/grok/2026-03-23/27790f48a54240ad8a1b5ca28a7c94a3.jpg"
    ],
    "quota": "0",
    "finishTime": "2026-03-23 07:23:50",
    "hookUrl": null
  }
}
{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}
{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}

Authorizations

TT-API-KEY
string
header
required

Please go to TTAPI Console to obtain the API key.

Query Parameters

jobId
string
required

JobId of the generated image

Response

Request succeeded

status
enum<string>
required

Task status: Pending queue / In queue / Success / Failed

Available options:
PENDING_QUEUE,
ON_QUEUE,
SUCCESS,
FAILED
message
string
required

Response message

jobId
string

Task ID

data
object

Task result

Last modified on March 23, 2026