cURL
curl --request GET \
--url https://api.ttapi.io/insightFace/v1/fetch \
--header 'TT-API-KEY: <api-key>'import requests
url = "https://api.ttapi.io/insightFace/v1/fetch"
headers = {"TT-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'TT-API-KEY': '<api-key>'}};
fetch('https://api.ttapi.io/insightFace/v1/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/insightFace/v1/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/insightFace/v1/fetch"
req, _ := http.NewRequest("GET", 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.get("https://api.ttapi.io/insightFace/v1/fetch")
.header("TT-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/insightFace/v1/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TT-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "",
"jobId": "c679a92e-dae0-462d-b70f-dcfeaf2189fa",
"data": {
"targetImage": "<string>",
"swapImage": "<string>",
"discordImage": "<string>",
"cdnImage": "<string>",
"quota": "3",
"hookUrl": "https://webhook-test.com/bf74f63b0d51ba1b3090e295aae057fe",
"finishTime": "2025-07-30T05:40:01Z"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}SwapFace
SwapFace Result Fetch
Query face swap task results. The returned data structure is consistent with the hookUrl return format.
Note: jobId can be passed via URL parameters (Query) or request body (Body)
GET
/
insightFace
/
v1
/
fetch
cURL
curl --request GET \
--url https://api.ttapi.io/insightFace/v1/fetch \
--header 'TT-API-KEY: <api-key>'import requests
url = "https://api.ttapi.io/insightFace/v1/fetch"
headers = {"TT-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'TT-API-KEY': '<api-key>'}};
fetch('https://api.ttapi.io/insightFace/v1/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/insightFace/v1/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/insightFace/v1/fetch"
req, _ := http.NewRequest("GET", 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.get("https://api.ttapi.io/insightFace/v1/fetch")
.header("TT-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/insightFace/v1/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TT-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "",
"jobId": "c679a92e-dae0-462d-b70f-dcfeaf2189fa",
"data": {
"targetImage": "<string>",
"swapImage": "<string>",
"discordImage": "<string>",
"cdnImage": "<string>",
"quota": "3",
"hookUrl": "https://webhook-test.com/bf74f63b0d51ba1b3090e295aae057fe",
"finishTime": "2025-07-30T05:40:01Z"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Authorizations
You can obtain your API key from the TTAPI Dashboard.
Query Parameters
Job ID returned synchronously by the generation endpoint
Response
Request successful
Task status: ON_QUEUE-processing, SUCCESS-success, FAILED-failed
Available options:
SUCCESS, ON_QUEUE, FAILED Example:
"SUCCESS"
Response message: empty string on success, returns specific error reason on failure (e.g., 'insufficient quota', 'prompt violation')
Example:
""
Unique task identifier for querying task status or receiving callback notifications
Example:
"c679a92e-dae0-462d-b70f-dcfeaf2189fa"
Data returned when task succeeds
- SUCCESS
- ON_QUEUE
- FAILED
Show child attributes
Show child attributes
Last modified on March 23, 2026